Included below is a short infographic on the process of songwriting. This just represents one of the ways a person can go about songwriting, and it’s a fairly basic one at that, but it’s great as a start.
The technique described is that of choosing a key, building chords from each of the scale degrees of that key, and then choosing a chord progression out of those chords to form the basis of the song. There’s tonnes of techniques out there for expanding your choice of chords beyond the 7 that this method provides, but generally most pop music is written on the basis of a handful of chords and is written using this simple method of songwriting. Countless songs use only three chords, for example, and most of the time the same chord progression is used for those chords (I-IV-V in a Major Scale).