This is a huge topic and there's lots of things that could be explored about it. I think there are many different ways to experience stage fright -- every time we take another step in terms of playing/singing in front of other people is another opportunity to get used to what that feels like. And everyone is different, so your experience of stage fright will be different from mine or the person sitting next to me.
Playing a song for your spouse/parent/child/best friend is different from playing a song for your guitar teacher, which is different from playing a song in a song circle or musical jam, which is different from playing a song at a local open stage, which is again different from performing a half hour set at a club, which is different than performing for three hours at a senior home... you get the idea, all the way up to doing a two hour show in a massive arena with 50,000 people (anybody here ever done that? Do tell!).
The point is that each time you push yourself into a new performing situation, there will be different things to deal with in terms of distraction and stage fright. You might be perfectly comfortable in one setting and absolutely freaked out in another. Or you might find certain things daunting in one setting but feel totally comfortable with those things in another setting. Understanding your own quirks, anxieties, distractions, etc. is part of figuring out who you are as a performer.
I have found that I have a constant running tape in my head. Whenever I play and sing, the tape is saying things like, "Okay, don't forget the words to this next part, and here comes that place where you have to play that tricky change, get your pinky ready, hey you did that pretty well, nicely done, oh, shoot, I didn't quite get THAT part, gotta practice that some more, what's the next line..." and so on. It is constantly running and it never stops. If I am in a performance situation, in addition to all the chatter about the song I'm playing or how many mistakes I'm making, the running tape is saying things like, "I wonder if they are liking it? Did they notice that I almost missed the words there? I've got to project a little more and smile, oh, there's a guy out there with his arms crossed. He looks like he really is not enjoying himself..." etc.
Whether I am playing by myself in my room, or playing in front of a huge audience, the more I engage with that internal voice and let it occupy my attention, the further away I get from being "in the music." And the less I am "in the music" the less enjoyable and relaxed the whole experience is for me. So I try to focus on listening to the sounds I am making, taking in the whole environment that I am in, and generally "being in the moment." I don't try to stop the tape from playing, I just try to let it recede into the background a little bit while I focus on something else.
I also find it helps me to think of performing as a form of two-way communication. It's not just about me getting up and projecting out. It's about the give and take between the two of us, me and the audience, at that moment in time. The more I remember that, the more I can be open to what happens, and respond to it authentically, which makes for a much more genuine performance.
And yes, it helps to be very confident about what you are doing, but it also helps to know how to recover and carry on when you make a mistake. And everyone makes mistakes. Some people are just better at moving right along without letting it push them off balance. That takes some practice, but the more you do it, the better you get at it.
That's my two cents for today. Thanks for starting this topic -- I look forward to hearing more of what others have to say.