There is no “right” songwriting method.
George Gershwin preferred to compose is melodies first, which he would then give to the lyricist.
Elton John takes the opposite approach, using a lyric to inspire his melodies.
Paul McCartney uses a variety of techniques, sometimes starting with a bit of melody,sometimes with a few words, and at other times with a rhythm or series of chords.
If you want to write songs, try all these approaches and see what works best for you.
Take your left hand playing to a new level with my free ebook: Left Hand Techniques for Jazz Piano
You’ll also get my weekly jazz newsletter with practice tips and inspiration