Why was John taking out the beer?
If you are referring to why John is always taking beer with him and drinking all the time over the course of the book, it's likely for a few reasons.
The reader is told that his father is a recovering alcoholic, so it stands to reason that John is genetically susceptible to being an alcoholic himself. We know that his dad encouraged him to drink at home while mom and dad were having parties with people over. His dad would often make jokes about it too.
It's possible that John drinks in order to numb himself from his home life. He doesn't get along that well with his mom or dad, and at times seems to even pick fights with his dad.
It's possible that John takes the beer out to make himself look "cooler" and "harder" to other kids around him. It's his way of making himself stand out from others, or even stand apart from others. Despite being very handsome, John is not swarmed with popularity.