It’s really in these moments that you can define yourself, that you reach out for philosophy and literature and ways to cope and face life.
As they say: life is made of failures, and it’s always about how you bounce back (not how you avoid failing)
The second thing is that life is made of multiple sub lives. Your life as a toddler was nothing like your teenage years, which was nothing like your adult life, which will look nothing like your life as an old person.
Transitioning is always hard, but growing as a person is also about accepting that we are not meant to live the same little cushy and stable life that we got accustomed to for too many years.
Breaking up is one thing, at some point close people to you will die, you will lose some of your physical abilities, etc.
The best thing you can do is find a strong philosophy of life, and not worry too much about what your life was or what your life will be. Just enjoy the moment.
Enjoy your experience as a human being. All of it.