Just like a language, you can start piecing your own sentence together with even the smallest knowledge of the language. As long as you know your way around the staff and the scales, you'll be fine!
Grab a piece of manuscript (sheet music) and a pencil, or find a piece of software. I recommend pencil for those who haven't spent the time to learn the software. You just need to start writing.
Write a Melody: It can be long, short, simple, complex, anything. For now, stick to a scale (C Major in my example) and write something simple. My example ends on a C which is perfect for an ending.
Add the Harmony: The harmony is honestly the hardest part. To keep it easy, pick a rhythm (half notes in my example) and change the chord to match the note you're playing, staying in key (C).
Expand the Harmony: Once you're happy with the way your harmony sounds with the melody, play with it. I've converted my harmony to an Alberti Bass pattern. You can do what you want to it, it's yours!
Play Around With It: Even after you think you're done with the piece, play with it some more. Try shifting a few notes, or adding pedal, or even changing your harmonic rhythm.
No, I'm not expecting you to write something like that. It was simple, but not something you could write first time. But this is the good part, if you keep writing, you'll get better, I guarantee it.
- Knowledge of Basic Music Theory