It may sound strange, but one of the biggest mistakes I made as an aspiring songwriter was worrying too much about how well I was playing and writing. I was afraid to write songs that weren't good. When it comes to mastery of an instrument and preparing for public performance, you definitely should worry about how well you're playing and performing. You don't want to get in front of an audience unprepared and sound like you're just banging out noise (unless that's your objective). But just like learning an instrument is a process of making mistakes that you correct and basic skills that you build upon, songwriting is a process that requires mistakes so that you can get to the good stuff (however you define good stuff).
So from the very first notes that you learn on the guitar, keyboard, oboe, sax, whatever, start writing songs. Take the first two notes you know how to play and start from there (be ambitious and start with one note). Build on it with the next things you learn. Write the lyrics if you want songs with lyrics and don't worry about whether it will ever be heard, just write it. A poorly written song is still a song, and it is an opportunity to learn what doesn't work so that you can move beyond it to the things that do work. Not making bad music is not making music - think of it this way, no matter how long a walk you have ahead of you, the walk doesn't happen until you take the first step. If you walk in a zig zag you won't get to the end quickly, if you take too many breaks or you get winded because you don't pace yourself, you may not get there at all. But each step you take is an opportunity to learn, to understand the mistakes that prevent your version of success, to find what you like about the process (maybe you WANT to walk in a zig zag to make the walk more interesting) and to eventually become the most efficient, capable walker you can be. You get to define what is a good walk, and what is a good song, even if that means letting other people tell you what those things are. Your experiences will tell you how to achieve the goals that you set for yourself.
Be confident that you are heading for the goals that you want to achieve. People will give you all kinds of definitions of success, but unless you're only going to define success with popularity and money, then songwriting by definition is writing a song - it may not be your profession, but you are a songwriter when you start writing songs. And writing a bad song is a step on the road to writing a good song. And unlike many things in life, a bad song can be set aside, brought back out in the future, re-written or used to spawn a new song. It's recyclable. It's somewhat infinite even if no one hears it. Wouldn't a chef love to do that with a dish that comes out overcooked!
And if you want to be a performing songwriter, the next step after writing the songs is to go play for anyone and everyone who will listen. In case you haven't figured it out yet, not everyone will like your songs even if you're the best songwriter ever born. So the fact that people don't like your songs is not a reason to avoid performing. You have to get the music out there in order to find the people who will like it. I'm still working on this aspect of being a performing songwriter. It's tough to perform without an inviting crowd to perform for - especially with my limited vocal ability. But you can at least find polite crowds who will listen and give you an opportunity to get your stage legs. Then you can move from there as you find opportunities.
If you're young and just starting to think about songwriting, or a seasoned player who is just now thinking of doing their own songs, get going. Write the song, rehearse the song, perform for people. That's the way to get going. And in today's world most towns have an outlet or a dozen outlets that will let you get those stage legs. Show how much you care about your songs and the work you've done by sharing them. Before you go to perform, respect everyone's time by preparing for your performance. It's o.k. to be new and unpolished, that's where we all start. But don't waste everyone's time by being unprepared. Making some mistakes is expected, but not knowing your song because you didn't rehearse is a waste of everyone's time. And for most of us performing on stage is a whole different experience than playing your song in your bedroom. Be professional - practice at home and be ready for your moment.