While a home studio would definitely be great to work in, you don't need anything quite so extravagant to start writing your own music.
1- First off, you'll need to decide what type of songs you want to write. Listen to as many different examples as you can, even if you think you don't like that particular genre.
2- Ensure you have an understanding of the basics; rhythm, melody and harmony.
3- Decide how you want to write the music; traditionally on manuscript paper, perhaps, or using a music-writing programme online.
4- Decide whether you want to write the music first and work on lyrics later, or pen your lyrics and then set them to music. Many popular songwriters say they often use 'dummy' lyrics, or even a jumble of nonsense words, just to have something to hum or sing as they're working on the music.
5- You'll notice most songs follow a set structure and include the basic elements of intro, verse, chorus and bridge, set out in different ways such as intro, verse, chorus, verse, chorus, bridge, verse. Decide what structure will work best with your song ideas. Once you've written each element, you can even play around and change the structure to see what works best for your song.
6- Work out how you'll record your music. It can be as simple as using the record button on your sound system or as high-tech as buying a specialist recording system.
7- Once you're happy with the final result, why not post a clip or recording on a sharing site such as YouTube? You'll get feedback from other music enthusiasts and could even pick up some hints and tips for next time.