1- Lay the guitar on its back, resting the head stock on small box or similar, to stop the machine heads going out of tune.
2- Grab a sheet of towel/cloth and fold it in half length wise. Fold it length wise again so you have a long rectangular piece. Do the same thing to the other sheet. This one will be the "Oiling Rag".
3- Slide the dry sheet under the guitar strings just near the bridge, then fold it over so the other half covers the top of the strings.
4- Now, slide this piece along the length of the strings, right up to the nut. Apply some downward pressure to clean the top part, and pull up on the paper to clean the underside of the strings too. (This is just as important as the top) Even if the head gets lifted off it's mount, it still helps.
5- If you notice a little bit of muck and dirt on the towel, then you're doing fine. It won't always be like that, but this step helps set the strings for the oiling.
6- Apply some WD40 to one side of the other piece of paper towel and wrap it around the strings the same way as the first piece. Run this piece along the length of the strings using the same process as before.
7- When that's finished, the strings should look noticeably shiny and be very oily and smooth to touch.
from wikihow.com