Writing tunes is a very hard skill. When you first try to write a tune you may think it’s impossible, or feel that you’re not creative enough, but there are some strategies you can use for tune writing. I have been writing tunes since I was 8 (7 years ago). Obviously I was writing the most complicating tunes at that young of age, but everything counts. Also I like to notate every official tune I write, because as good as your memory might be, you could run the risk of forgetting a great tune.
One strategy would be whenever you have any sort of small idea for a tune, even if you think it’s bad or not worth even trying, you record it. Eventually, maybe even 6 weeks from now, when you’re looking back on your recordings you’re going to come across this tune idea and maybe this tune will appeal to you now. Perhaps even part of what you created can inspire a new tune or form a phrase in another tune.
Another strategy is choosing a random key. When you have a key in mind – play that scale repeatedly, but each time make the scale your own, improvising around the scale. Eventually the scale will get more and more complicated, forming your tune.
There are many ways to write tunes, but if you’re having trouble these are what help me.