I tend to either:
>Speak with the players directly and say that they're making it difficult for you to enjoy DMing
>Ask for someone else to run a one-off session to 1) Give you a break and 2) Let them feel the pressure of the DM role
>At the start of a session say something along the lines of "If you have an issue with/question about the rules that's okay but let us talk it out after the session so that we don't waste so much time"
First tends to work a lot, second I've only done once but worked well, third I've had to do for a group I knew had a few rules lawyers and idk if it was because I said that or just a good few sessions but I didn't have a problem