You’ve got a million pieces of advice about the burnout, I’ll comment this:
> I've always wondered how other smart people are able to come up with libraries, services and various solutions from scratch.
Read books. Classic programming books - Knuth, Robert Martin, Erich Gamma, and so on.
Find 2-3 hours per day - it is one of the best investments you can do.