Music composition requires a working knowledge of melody, harmony, structure and notation.
Once these basics are understood, it's easy to develop a simple 3 minute piece from two short (say 2 bar) ideas.
GCSE music (UK) contains extensive music composition alongside performance and listening and appraisal.
Over the years, I've coched students to good grades, from staring blankly at a comuter screen wondering how not to fail!
My publication 'GCSE Music Rescue' is avalable to download