you've got to crack a few eggs to make an omelette
Sometimes, you have to do unpleasant things in order to complete a task or meet a goal. Your students clearly don't respect you. I know you don't want to yell at them, but you've got to crack a few eggs to make an omelette. If I don't cut people's salaries, the company is going to go bankrupt. It's unfortunate, but you've got to crack a few eggs to make an omelette.