Up to the age of 30+ I could have written exactly the same as you. I really, really struggled to gain confidence - and recognise that feeling of people reacting differently to you, so then it all feels more awkward, and it's tempting to withdraw more.
It's probably different for everyone, but I found that when I combatted anxiety with some CBT, it had the knock-on effect of (very, very slowly) helping with social situations too.
Also, I got involved in a group online, around an activity that I liked, and found it easier to join in conversations there - there was time to think, between posts, rather than the intensity of being in a conversation. So it got easier to chat, and more and more to behave, in online conversations, how I would have liked to in real life. I overstepped the mark, occasionally, in perhaps making a joke and panicking that others would think I was being an idiot, but actually it all worked out fine.
Eventually, I ended up socialising in real life with some of the online people, and because I already 'knew' them a bit from online, it suddenly became so much easier to talk, as they treated me like the person I was there, like me. Plus, because they were also online, I found that lots of them were similarly awkward in social situations.
It genuinely, over almost a decade, changed the way I related to others (as that confidence then spilled over into offline relationships too). It's not always easy, and I'll always be an introvert, but it radically improved my life. If you have an interest you can get into (away from yourself), like writing, or almost anything else has a community now too, I really recommend joining a group on social media and getting yourself involved. It's not easy, but you've identified what you want to change, and it can, eventually, happen, with effort. All the best!