How do you stay professional at work, and not get emotionally involved?

I’m other words, as the months and years go by, how do I remember that “it’s just a job”?

The first 6-12 months at a new job or postion, I’m able to act like a professional. I stay positive, I’m friendly, I’m proactive at solving problems.

But eventually the daily grind starts to wear me out. I’ll do things like get frustrated when I see laziness or incompetence cause more work. I’ll slowly start joining in the gossip, responding with sarcasm, complaining about management and customers. Basically sabotaging myself.

How do you stay professional day in and day out?