Singing in tune is a part of the singing discipline that is often overlooked, because it is assumed that people cannot learn to do it. It is certainly possible to learn, but it takes some regular exercise. You need to train the ear at first rather than the voice. You need to be able to sing a pitched note before you can sing an entire song.
Steps
Method 1 of 2: Using a website

Step 1. This is a part of the singing discipline that is often overlooked because it is assumed that people cannot learn how to do it
Now you can learn via this free site:

Step 2. You will need a microphone and speakers connected to your computer

Step 3. Open the site and follow the instructions

Step 4. You have to practice for 10 minutes a day, but soon you will begin to "hear" the notes you should be singing
You are teaching your ears to listen to your voice.

Step 5. Always play the note before singing it to build an association between what you hear and what you sing

Step 6. Once you get into the habit of singing in tune (the software author says it takes about a month of practice), you can try singing a note above a chord
To start, sing the lowest note of the chord.