Burnout
I wouldn't focus on the burnout, sometimes we get too much into our own heads about being burnt out.
Really take the time out, i.e. leave the office, go for a coffee, etc. to focus on the things that bring you happiness: are you in a relationship, do you have pets, are you exercising. For all of those things, if you are aren't appreciating them or relying on them enough, acknowledge that and maybe reconnect with those things a bit more.
Also, anticipate the moment when you can announce your resignation, and be prepared to leave. Have the things you are working on documented and your transition tasks ready, not only will it feel like you are "doing work" (because...you are) but you are also working towards leaving, which I think should be a good feeling.
Interviewing under duress
Also, focus on the process of getting ready for the interviewing process. Don't want to sugarcoat it, it can be a serious slog. Preparation is crucial, and you have to be in a good mood, when talking on phone screens, no one likes a "low energy" candidate. So, you really need to compartmentalize the stuff happening at work.
Some strategies:
- Think of it as a side project, and that each call, interview is a little adventure.
- Enjoy the madness that it is, we all know the interview process is broken, at the worst, you'll have some excellent stories about bombing-out
- It is a good market for devs, if you are competent you will find a job, trust that your prep will get you over the line.
Office Space
As far as the office itself, that's a more difficult story. I think trying to adopt the "it is just a job" 9-5 routine is way easier said than done. So I wouldn't bother, especially, if you are at all personally invested in your performance as a individual, it is hard to just turn it all off. Instead, I would focus on small wins, small wins in your code, small wins with your managers, and recognize that the losses you experience are also very, very small, and in six months should be mostly forgotten.
Finally, as far as the experience that "ruined your faith," you can't let it eat you up too much. Not every company is like that, though every company has its problems, accept that you are in potentially a unique situation (though not unique enough) and put it aside, until you can be in better headspace to manage it. Sometimes, you can't juggle all the things.
Best of luck and study hard.