Playing guitar is not as easy as you think if you do not have any background on music or the guitar itself. There are some preparations like tuning that you must follow or check. But not to worry much, there are a lot of sites that offers guitar lessons for free. You can also watch video and training materials from experts.
There are also books, PDFs and online instructor which you need to pay to teach you one on one on how to play a guitar.
Most popular way is by self learning. I know a lot of people who are very good in playing guitar and only learn it by watching other people play and trying it themselves.