For all practical purposes, creating music with the 12-tone chromatic scale that underpins all Western music is really just picking a formula and filling in the blanks.
Write a rock song: Pick a key and play a I-IV-V progression. Intro, solo, and outro in the key or relative minor.
Write a pop song: Pick a key and play a I-V-vi-IV progression.
Want it to be angry? Power chords! Want it sad? Play in the minor scale! Happy? Major scale! Create some tension? Use both major and minor scale! If you're soloing, make sure the first and last note played in a given bar match the chord being solo'd over.
That will get you about 75% of music written since the 1940s.
Western music is a formula.