Bonhoeffer once wrote: A pastor should never complain about his congregation, certainly never to other people or to God. A congregation has not been entrusted to him in order that he should become its accuser before God.
Wise words, indeed. CFW Walther, the first president of the LCMS, said that a pastor should see his call to a Christian congregation as a call to paradise.
What to do when some in your congregation aren't very Christ-like?
Start by taking a look in a mirror? The pastor can start by asking himself, "Is there something I've done or failed to do to cause this person or people to behave in an ungodly way?" If so, repent and seek the Lord's forgiveness and restoration.
Secondly, communicate. Speak to those who seem to be causing trouble. Perhaps they are troubled but something you are unaware of and this trouble is impacting their life and how they treat others.
Thirdly, pray. Ask the Lord for His help. Seek His wisdom and strength. And remember all the other times you went to the Lord with a problem and discovered that He already was at work in resolving the trouble - even before you asked Him.
May the Great Shepherd of the sheep, the Lord Jesus Christ, help all of us under-shepherds to love our flocks - His sheep and lambs!