There's no single right way to write a song. Songwriters approach their work from different perspectives all the time. In order to generate fresh ideas and pull yourself out of a songwriting rut, you should try writing songs differently than you normally would. For example, if you tend to write songs starting with lyrics, attempt to start with a melody and apply the lyrics later. If you tend to write songs on a guitar, try writing a song starting with a drumbeat. You could stumble upon an idea you may never have considered by diversifying your approach.
While it's true many of the most famous songwriters never had any formal training, all songwriters are influenced in some way by those before them. Songwriting is a craft, and listening to and studying music will hone your skills. Songwriting may be an individualistic form of expression, but you can throw open the floodgates to your creativity by immersing yourself in a variety of music and songwriting styles. No matter what genre of music you want to write, listening to artists outside that genre will expand your songwriting palette. At the same time, read up on music theory. Being aware of notes and their relation to one another will improve your songwriting. You'll be better prepared to tackle situations that may come up in writing a song, such as what chord to go to next or what notes best harmonize with one another.
Just as listening to and studying a variety of music will improve your songwriting, practicing and writing songs as often as possible will do the same. By writing on a daily basis, you will work out the kinks in your songwriting technique and open the door to new possibilities. For example, you may notice that you tend to fall back on similar chord progressions. By practicing every day and being aware of your songwriting deficiencies, you can work on weeding them out and introducing new chord changes, expanding your songwriting gradually.