Bob Dylan is known as one of the greatest songwriters of all time, but his advice to young songwriters is to not sound anything like him. "You can't just copy somebody," Dylan said in an interview with the Los Angeles Times. "If you like someone's work, the important thing is to be exposed to everything that person has been exposed to. Anyone who wants to be a songwriter should listen to as much folk music as they can, study the form and structure of stuff that has been around for 100 years." He recommends folk music because it is music that depends primarily on songwriting for success. It is a style of storytelling that taps into both an intellectual and visceral realm of human nature, thus making it a very solid foundation for the craft of songwriting.
If you've written lyrics but don't know what sort of music to put with them, or if you've written some riffs and you want to fit some words into the music, the main thing to remember is to not force anything. If lyrics haven't come to you yet, just wait. Play the music that you've written and don't write lyrics for it until you really get a feel for the aesthetic sounds you've crafted. Once you're in touch with the true nature of a song, the rest will play itself out. Never rush songwriting, but do maintain a dedication to personal inspiration and integrity.
If you've never played an instrument or written lyrics before, you have a lot of work to do. But before you can write a song, you have to consume the music of the great songwriters that came before you. Listen to as many of the songwriters you like and to as much of their music that you can. If you surround yourself with great songs, you'll get a feeling for what it will take to create your own. It's also not a bad idea to take writing classes.