Go to www.hooktheory.com

Please help I need to know how to create melodies like this

I would like to know how to create melodies as well as the ones shown in this video at minute 19:28 youtube.com/watch?v=Te1FfrLlT30&t=418s

So what they do to make the melody at 19:28 is