Do you play any instrument?
This is how I started: I used to sit in the piano and learn a few songs, whatever you like, Debussy or High School Musical, it doesnt matter. Then I started to change the songs like, I would prefer this one octave higher or add a little trill... then I learnt a few songs to sing along and this way I started to learn the chords and, eventually I was improvising different melodies. Lets say you stick to a chord progression (Am, F, C, G) and you start singing any pop song that you like. Then you can actually try to change the melody, create different voices for backing vocals is a good way to start improvising (if you don't sing just use your right hand or whatever in your instrument) This might sound stupid but that is how I actually learnt to create melodies and the basis of music theory.
Once you learn the basis then start to record things in your daw. Finally learn some music theory (I just played the piano until my fingers knew where to go, I prefer this than the actual theory, but the theory is easy as well) Learn more chords to enrich your sounds (you will get bored from the Am, F, C, G quite fast), copy weird chord progressions from songs that you like, then learn a few scales, modes... (i really like dorian and lydian mode, I use them a lot for my soundtracks)... This is how I learnt.
I know there are some people that compose music as if it was lego with samples and loops, but I hate that because you will never be free and truly creative, that is just my opinion.