Some good fundamentals:
1. Write melodies you can hum, not too complicated but catchy
2. Learn song structure
3. At start its better to stick to one key, so use scale highlighting in your daw and go crazy :D
Toby fox guide on making music (google it, its quite easy to find on wayback machine) is a good guide for music i used a plenty when i was starting almost one year ago :D