Not a complete answer because I don't really know how to do this myself yet. But I do have a few pieces of advice.
For an amateur, getting on paper (or in the computer) something which you can hear in your head is hard. In fact, my general piece of advice for someone who's only just starting out in any musical capacity who has something stuck in their head - is to let it stay there in their head. At least for the time being.
All the songs I've successfully made, I've made through a combination of screwing about and applying basic bits of music theory to the stuff that sounds nice. They've grown organically.
Almost all the songs over the years that I've made up in my head have resulted in abject failure when trying to transcribe them. It just never quite sounds how it's supposed to. The problem for me is that what I have in my head is often supplanted by the wrong notes I'm trying out on the keyboard, and I can no longer remember what the notes were supposed to be.
So here's my advice:
- Make sure that you have your song firmly planted in year head. 'Listen' to it over and over so that you'll be able to remember it tomorrow and the days after.
- Study your song, don't just let it idle in your head. Yes it sounds weird to talk about active vs passive listening to something that's only in your head, but you do need to actively break it down into its component parts.
- I disagree that perfect pitch is necessary. You only need to be able to identify chords and intervals. If you are able to identify what that specific chord/effect/interval/tune is, that's great. Write it down. Otherwise, leave it until you've gained the experience needed to identify how it's composed. There's no rush. If you're able to keep remembering it, you can work on bits of it any time.
Working on the skills needed to transcribe what's in your head is a lifelong process. It's tricky, but with practice and effort you ought to make some decent progress.