It's simple, but may be hard to do.
no caffeine(withdrawal may suck for a few weeks or even a month but it is worth it)(you can continue drinking it only after you have dealt with your problem),
Fix your diet and gut.
Lowish carbs, not keto. Good source of carbs is white rice. Plenty of animal fats and don't overeat plants and fiber.
Eat only when you are hungry.
Drop or contact as little as possible all the people that are net negative on your emotional state, that includes coworkers, gf, family.
Find like-minded friends if you do not have them.
No work in the evenings, only leisure, hobbies, hanging out with friends, family.
You may be overdoing it. If you do not enjoy exercise and it feels like chore, take a big break, 2-4 weeks.
If not, then exercise(weights) 3x-6x times a week as long as you enjoy doing it.
If you do all the things mentioned before I think your sleep will automatically improve(although it may make it worse temporarily, especially dropping caffeine).
Some little tips that can further improve sleep: no blue light in evenings, no big meals in evenings, cool and dark room.
I think there is no need to track your sleep on your phone, it makes you even more neurotic.