Talking to a therapist can be helpful in getting to the root of it. Meditation also helps, but it may be a longer road. In other words, whatever helps you live a more examined life.
Regarding habits and the habit loop (what's being mentioned here), "The Power of Habit" [0] is a great read.
I can also suggest small internet communities as these can be places to form friendships while having some PII type of anonymity and at least for me helped me be more open before I was ready to open up to friends. Places like HN and reddit are probably too large, but hey, I'll put this out in general to anyone, feel free to reach out over email[0]. You can also get something similar by just talking to random people at a bar.
Whatever works best for you, but it all is a noisy process. But at the end of the day I think what's most critical is that you find some means of just opening up. You don't have to stick to one group either, and if you need to start at one place to build up to another, there's no problem with that. Take it as a journey, not a destination. But I will say having at least a one or two core friends (and ideally a partner) is going to be one of the most helpful things you can do for your mental health. A therapist will never be enough but you should think of them as a very useful and different tool (because you do want advice not coming from those who want to protect you. Outside opinions are invaluable and a good therapist will do their best, but consider they can only work with the context you give and what they can get from you).
[0] In my profile. And if anyone has a suggestion for a better anonymous email, let me know. I'm kinda annoyed at proton's ads.
Also, if you're struggling with getting things done because you're always dopamine seeking, get checked for ADHD. There are some extremely effective treatments that can make your life way easier if that turns out to be the problem.