You can attempt to teach yourself how to play but this can take way longer than a more general approach. I say, find yourself an online course. There are many good online guitar courses to choose from.
There are a few really good online guitar courses that can help with the basic stuff and advanced techniques. Online teaching can learn the chords, how to read sheet music and the correct way to play by ear. There are even theory experts who can teach you how to listen to any song and be playing it in no time.
Once you get the basics of guitar playing you can move on to advanced things like pull-offs, hammer-ons, step bends, half bends, and more. There's also legato and tapping. Don't be scared by these words. Once you learn this stuff you'll realize how great the guitar is. There are systems that can get you to learn to play step by step. Learning guitar is an exciting endeavor.
Once you pick up that guitar, you will not be able to put it down. Getting good is so exciting. The top feeling is when you pull out your guitar at a social gathering or play for a loved one and you're actually a good player.
There's no better feeling than watching people listen to you play guitar or even just playing by yourself and getting all of your feelings out through your guitar. Playing guitar is an excellent way to express your feelings.