The best way is practice you simply get used to anything the more you do it.
When I was in HS, I joined debate club, where we spoke for 5-10 minutes at a time in front of anywhere from 5-20 club friends or opponents. When you do this repeatedly, for most people, your anxiety and nerves eventually go away, and it s just what you do now.
The same was true of musical performance: I hated performing until I did it about 50 times. Then I got comfortable and my average performance was no big deal.
Another idea: which language are you native in, and which are you using to speak confidently? If it s not your primary, that could be part of it. There s also focus-related disorders, if you have ADHD or similar, then your symptoms would make sense.