If you consider the idea of music as language, genre as somewhat akin to regional dialects, and performance as akin to a recitation in that dialect to an audience, then the most fundamental prerequisite for composition is having something to say.

My background is in jazz, and often I encounter beginner students who have learned enough about the pedagogical aspects of music to know about a thing called theory and that there is virtue in knowing it, but they also mistakenly believe that an knowledge of theory is sort of the fountain from which ideas flow, which is not the case. For example to learn to compose and improvise in the jazz idiom, the way I learned it, the way essentially all the people I play with learned it, and how I teach my own students to do it is to internalize a great deal of music in your chosen style by players whose style resonates most with you. Memorizing changes, transcribing recorded parts on whatever instrument you enjoy playing, and so on. After doing this for a while you will start to develop a vocabulary of musical phrases which will occur to you spontaneously as a reaction to some kind of prompt, for example in jazz there are common sequences of chords that occur frequently in compositions, and by absorbing thousands of melodic phrases that occur over those changes you will have an innate idea of what you like to hear over them without having to think analytically about the relationships between tones and scales. You can certainly apply knowledge of theory to expand on your ideas in an analytical way, but the intuitive part needs to be developed first.

Many beginners balk at this idea because they like the idea of having purely new ideas, and you can certainly do music however you want, but I think ultimately most composers/performers want audiences to hear their work and there is a tacit relationship between the two; the audiences have an opinion about what sounds good and if your compositions don't sound like the genre of music they enjoy, neither of you are likely to be happy. I like to use the analogy of stand-up comedy; your jokes may crack you up but people don't want to watch somebody else laughing, so you have to meet them partway.

So having said all this, I think step one is to develop some opinions about what you think sounds good. Make a list of your favorite recordings and your favorite performances on those recordings and learn to reproduce them somehow. If you don't play an instrument, figure out how to sequence the changes, or noodle out a melody on the piano (if you don't play any instruments the piano is the smart choice, since it's like knowing how to type if you're a musician). The act of making these reproductions will tune your ear to hear chord qualities that might not be apparent to you until you try to recreate them, and relationships between notes in a melody and the supporting changes that you missed when just listening.

During that process, take time to just play. Undirected noodling on an instrument is the way you develop an intuition about where the notes you like live in relation to each other, and bumping around the space of notes on an instrument is a great way to learn.

At some point during those play sessions, you'll have an idea that'll get stuck in your head. Capture those ideas, save them, and then when you have a few you like, its time to start working on the composition process, either by notating/sequencing them with software instruments, or making a recording of mixed live/sequenced performance. I generally use Garage Band for making demos that I give to people I perform tunes with, some of my friends love Ableton Live, and the friends I know who do arranging for a living typically use something like Sibelius to produce scores.

I think that after you've made a few compositions of your own, if you decide you want to continue, its not a bad idea to take an introductory course on harmony to help develop your ear so that you can identify sounds that you like, but I think its best to do that after you have started to develop an intuitive sense of what sounds good, since that's the skill thats going to determine whether you make something that is interesting and not built from a formula.

Good Luck!