Singing while playing guitar comes more naturally to some people than others. (Maybe they're the same ones who can pull off the "pat your head, rub your stomach" trick on the first try.) Most of us, though, need to train ourselves—minds and bodies—to do two (or more) things at once. The key is to take it in steps, mastering one thing until it is second nature (or close to it). Then adding the next in bite sized pieces.
Here's how I help my students get started singing and playing together. I call it Strumming & Humming.
1. Choose a song with a simple chord progression (no more than three chords) that you can sing easily. Start with something you know really well so you don't have to think too hard about the melody or the lyrics. Create a chord chart for the song by writing out the lyrics and writing the chord names above the words so you know where the chord changes and the lyrics match up. (Chances are you can find one online if you don't feel like making your own. Here's one for This Land Is Your Land by Woody Guthrie.)
2. Practice the chord changes until you can play them smoothly at a tempo that you feel is acceptable for singing along to.
3. Now, as you strum the chords, hum the melody. Start out with a simplified version where you aren't humming every syllable of every word. This is to get your brain used to moving your hands and making sounds at the same time—and at the right times.
4. Each time you get comfortable with what you're humming add more complexity until you are humming the full melody note for note. This won't take long once you get started.
5. Now start adding words. Start with the lyrics you are most familiar with, maybe even have memorized. Slow down if you have to and if you get stuck on how the rhythm of the words match to the chord changes go back to humming the part that hangs you up.
Stick with it and you will get it. What's great is that like riding a bike, once you're mind and body have figured it out, you will never forget how to do it.
And remember, have fun!