There are two ways to create a melody, you can place in notes, or you can play notes on a midi keyboard. We recommend playing your melodies. We say this because being able to play an instrument will carry beyond a DAW.
When recording a melody on a midi keyboard, we suggest hitting the record button before you have a pattern ready to go. Oftentimes you will play your best pattern first. Beats are not meant to be over complicated, what you come up with first or second more times than not will work.
You can always edit your recording or not placement as many times as you like, this is a major benefit to using a DAW.
When selecting sounds for a melody (just like any other instrument), you want to pick high quality sounds. This means in order to create the best melodies you need to have the best VSTs with the best sounds.
You want sounds that mesh well. You want your patterns to not be too repetitive. If your melody is too repetitive; switch the melody up by adding new sounds, filters, or whatever makes it interesting.
Don’t hesitate to layer sounds, especially chords. This will create a more full, unique sound. This does not always work like magic but you should give it a try.