A composition can simply be put as a harmonious mixture of several different elements by means of music. It requires time and experience and is a quite serious procedure. Some of the well known compositions we still listen today have been completed in years! Although anyone can compose anytime, the real deal is its quality.
Composing a musical piece from scratch requires confidence and determination. Its other pillars are talent, experience and imagination. It is totally up to your creative skills to form up an aesthetic sequence of notes. Plus, for a musical piece to be named as a composition it must either be recorded or written down.
Creativity and imagination is never enough alone during the process of composing a new song. Having well-developed technical skills are crucial too. With the help of such skills, one's ability to produce the desired melodic output will be easier.
Another aspect with a significant importance is inspiration. Some artists may be inspired by living things while others can be inspired by emotions or objects. When this initial power meets with proper dosage of creativity an immense amount of energy comes up.
Most of the musicians nowadays choose guitar and piano as backbone of their composition process. Main reasons behind such tendency are the ability to play single notes and chords in both of them and ease of working with lyrics. Experimenting and trying new things never hurts, but know what to expect. If you've been listening to a specific genre for years, composing for something totally else may end up with disappointment.
"Music is the purest form of our emotions."
To sum it up, composing a new song requires a good amount of time put in work, dedication, technical knowledge, imagination and experience. If you are into composing a musical piece but don't know where to start, you can start by taking musical theory classes at musiconline.