I found these two things particularly helpful:
1) Developing a practice of meditation
This helps to notice the self-absorbed thoughts and recognize them for what they are. I'd recommend in particular attending a silent retreat in Vipassana tradition https://www.dhamma.org/
These retreats are organized all over the world and are donation-based, so you can afford them regardless of your financial means. It only takes time and dedication.
2) Developing interest in other people
I was surprised that this can be learned, but it certainly can. I've often heard things like "assume everybody knows something you don't know" or "everybody can teach you something". I've found this advice to not be particularly helpful. It didn't offer a process for developing this interest.
The advice here offers a more practical approach: https://www.quora.com/How-do-I-become-genuinely-interested-i... (tdlr; it's an exercise of writing down things that you appreciated about the people you've encountered).
My personal experience with this practice: a) I notice what I appreciate and find interesting about the person I am speaking to more frequently and sooner into the conversation. b) I notice afterwards that I derived far more satisfaction from conversations in which I was interested in the other person rather than when others were interested in me. However, during the conversation I still crave attention. I am starting to notice these cravings as they happen. It's a little like eating a healthy meal vs. eating a cookie.