
Jerry P. answered 06/26/19
Very Experienced Piano/Keyboard Instructor
Both ways work. Melodies can pop into our heads, often in the middle of the night. Play it or write it down. The melody dictates what the harmony/chords will be.
On the other hand one can write a song from a chord progression. an excellent example is LET IT BE, by the Beatles. Mc cartney came up with it by figuring out a chord progression and the rest as they say is history.