I don't code anymore. But one thing that helped me, is that all of the neurodivergent people I have worked with have a super-power or two, that offsets their failings. One of mine is seeing systems as a whole. Another is a photographic memory for certain things, although working through them is a great cause of insomnia, i can run through conversations over and over until I see the inconsistencies between what different people told me. The solution to a major problem often seems totally obvious to me, however the anguish I am about to cause other people by pointing it out to them is not obvious to me at all! Find those things, then find a job that lets you exercise them.
I tend to get recruited to companies in a state of extreme flux, and I'm great at stabilising them. When you are in a disaster people are much more willing to change!
Read about other people's rules and hunt out your place in life.
Kind of ironically, things got easier for me once I was more senior. I would recruit a team of super-organized people to kind of fill in my gaps. They value my insight, and also my (ironically) empathy I show towards them. I think I had to try so hard to study people, that I became better at it than most normies.
It might take a bit of searching but you will find your place. I was a legend at the majority of my roles and a failure at 2 others. You have to find your fit. Flexitime is useful btw.
Lastly, beware of burnout. I'm going to say it again beware of burnout. It is easy for some of us to become obsessed with problem solving to our own detriment.