Note that psychologically, it's harder to sing in front of 3 friends than it is in front of 100 or more strangers. Once you get beyond a certain head-count, they just become anonymous blobs - a crowd rather than individuals. At that point you feel the overall crowd reaction to your performance, no longer individual people.
Just the same as learning to play or sing in the first place, learning to play to an audience is something that takes practise.
I started young, 6 or 7 years old, in the school choir. By the time I was 13 I was in a local amateur rock band. I recall having nerves at the first few gigs, but I had the support of my friends in the band. We all supported each other so that no-one felt alone - we were facing the world [or the small audience of friends & strangers] as a unit. By the time I was playing 40,000 seaters a decade later, I'd got the experience to back my own confidence that what I was about to do would be welcomed by that audience. The fear had been trained out of me.
Climbing that first hurdle is where you need the support of others. Don't go straight into solo performance. Don't let that cringing embarrassment of singing to half a dozen close friends prevent you from trying out a larger audience.
It gets easier with time & experience.
If you think it's because you're not good enough yet, then be honest with yourself. Are you good enough yet? Record your performances & listen back. Play the recordings to friends, but don't rely on their feedback because friends will never tell you they hate it.
If you really are trying to run before you can walk… then first learn to walk. You have to have a certain amount of self-belief to take to the stage in the first place. It's a whole lot easier if you know you can sing than if you only think you might be able.