By only focusing on things you CAN control. Yes very hard in practice (even I cant do this, but sounds like a sound advice to me)
Every time u fail , just think does this thing mean anything after 5 years, mostly the answer is no.
Also , this project might be one of hundreds of projects your org has and your org might be one of thousands of such orgs . Believe in yourself.
In life , always the priority is family and health, you and then job/career
By looking around at other office folks. If such idiots can also remain employable, get a hike, and continue to prosper, I will probably make it