I write song for 2 bands in which I am a singer and a rhythm guitarist. I think that anyone can write a song, but it depends how good. Know that I will cover only the basics here and a few tips I learned from my songwriting process.
So you know to play an instrument (or not) and you want to write some songs. I will help you mostly with lyrics writing and just a few things about the music. First of all know that you can not write a song if you just sit down and say "I'm gonna write a cool song". I mean you can write a song, but the question is will it be any good.
The big role in your songwriting plays the music you listen to and I don't mean just the genre, but the actual songs you have been listening for the past couple of days. If those songs are sad, you will write sad songs and if they are joy full you will write joy full songs and so on... The same thing stands for the music. Now with that said I can't explain the same thing in one article, but I will try to gather them all together and maybe do them separately later in more articles if you wish for me to.
Now let's say you decided what kind of song you want it to be. I listen to punk mostly and let's take that for an example (though it's close to rock and similar genres). Your song reflect the way you feel or you can just write a random fun song, but know that it won't be as good if you're feeling sad or bored. Before you start writing, listen to the bands you like and would like to be close to their sound, that will give you some idea where to go and it doesn't mean you will be coping them.
You might have already tried to write a song and it didn't go as smoothly as you thought it would go. You might need to change the room or the place where you are writing, because that can play a big role in your inspiration. I also have a ritual to wear my shoes and dress in my style while I write songs at home, of course with my bass or guitar in my hands.
There are two ways to write songs, lyrics first and then music or the other way around. I prefer to write guitar parts first so I can fit the lyrics easier and have a riff I wanted. When you write lyrics first you might end up on just 4 chords song or you might not fit the music well with the lyrics.
When you have your guitar parts done and let's say you took the standard structure (intro-verse-chorus-verse-chorus-bridge/solo-chorus-outro).
Know that the first part of the lyrics you start out will in most cases be the best part of the song. Either way if you start with the verse or the chorus the recipe is almost the same.
You want to think of a story in your head that matches the feeling of the style you want your song to be. If you are making songs for money, fame or getting girls you should just write about stuff that people can relate to like loving or losing someone, parting, drinking and if you want to write songs because of the feelings you have you should write what you feel is right or the things you like, but it doesn't mean people won't relate to it and it could also be about things I mentioned above, but it could also be anything you wish to write a song about and I mean everything.
The verse should be the part where you get people into your story and explain things in details and the chorus should be the part where you tell the main theme of the song and it is usually catchy, rhyming, easy to sing a long to and easy to remember. To make your chorus different from the verse you should add more energy to it, repeat some parts or words and sing the "main" words in your song in it (by "main" I mean if the song is called "Summer" you might want to put summer, fun, hot, nights and things like that in the chorus). Good thing you can do is that the last time you sing the chorus, you can change it a little and tell the real reason why you wrote the song. By this I don't mean you should always write something like "I am writing this song because I love you", but instead write something like "Now you know how I feel when you're gone". I had to take a love song for an example because it's the best way to show what I meant.
Now the verse like I said is the part where you should gather things that get listeners into your story. You might or not rhyme your lines, it's up to you. Though it's proved that the people who weren't taught about music would prefer the songs to rhyme. The easiest way to come up with the verse is to play your guitar and hum the words that first come to your mind while you're playing and writing those words even if they don't make much sense. Later go trough the words you wrote and correct them in the way you like them. Many times I end up with my song going into the other direction just because I wrote something that I feel is better than what I had in mind. Inspiration might strike you at anytime so be sure you have a paper and a pencil near by you or even better if you have your instrument near you.
This was just a general intro to songwriting and I gave you a few tips, though I didn't write everything I know, it would take too long for you to read it so just tell me in the comments if you want me to take time to explain every part in the song how it's written and give you a few examples. Thanks for reading, hope I helped or at least motivated you!