After the song is written:
You start pitching it to everybody with a pulse, have tons of people tell you how to re-write it, or pitch
their songs to you, etc. Then, if you're lucky, someone contacts you and offers to sign the song, then sends you a contract that puts your attorney in hysterics of laughter.
It's quite fun, actually.