Here are some resources that you may find helpful:
1) https://en.wikipedia.org/wiki/Midlife_crisis
2) https://www.nature.com/articles/s42003-021-02206-x
3) https://www.theatlantic.com/magazine/archive/2014/12/the-rea...
4) https://openthemagazine.com/science/the-genetic-origins-of-a...
5) https://www.fatherly.com/health-science/am-i-having-a-midlif...
6) There is a tradition of "mind training" in Tibetan Buddhism called Lojong (https://en.wikipedia.org/wiki/Lojong) which you may want to study, learn from and put into practice. These are basically a set of practical advice/sayings/aphorisms/proverbs/etc. which teach you how to develop/modify your attitudes and perceptions towards life/other people/yourself in general. It was developed in the context of Buddhist practice but you can easily transfer the principles outside of it. A good starting point is the book Essential Mind Training: Tibetan Wisdom for Daily Life translated by Thupten Jinpa.