If it's truly getting to the point where it's affecting your mental health, the job is no longer what you should prioritize.
Strive for excellence, not perfection, in everything you do.