I must say that nothing really beats listening to the masters as a way of ear training and inspiration...masters in all genres...allowing their music to really get under your skin, giving you excellent examples of well written material and templates you can use for your own attempts. There is nothing wrong with imitating and even attempting to re-write a piece you love in order to discover the structure, form, and flow of the piece. Learning to dissect songs...discovering chord progressions, keys, scales and modes used to create the melodies, will get you headed in the right direction.
You may ask yourself; OK... so what shall I compose? Where do I find inspiration? Do my compositions need to be about anything?
Life experience, your relationships with friends, family, and loved ones...this is rich ground from which to gather emotions that can be translated into music. Your spiritual life and connection to the soul and so called higher realms can also serve as great jumping off points for your composing.
Many composers, including myself, have also found inspiration in concepts and themes i.e., mythology and religious stories, world and social events, holidays, famous people etc. This is sometimes referred to as program music.
And there is also what some serious composers would call music for music sake. Music that just flows, creating its own conversation, with no serious subject matter or concepts to express, just the sound and texture of music making its own way...a world of sound unto itself.
To create a memorable piece of music, a piece that really connects to your audience is a worthwhile goal. You may be able to create music that has this effect, but there are no guarantees. However, the muse may touch you on the shoulder someday and inspiration may strike! However...if you are not prepared or if you have not at least begun to do the work...the muse may smile and laugh as it disappears... and you will have to wait for another day.... a day when hopefully you are more prepared. :-)