Ummm...there are lots of ways.
1) Pick any good program written by an established coach with a track record of success.
2) Follow said program.
3) Eat properly. Quality protein, quality fats, quality carbs, eat your vegetables.
4) Sleep properly.
5) Don't do things that are destructive to progress. At least not too much. You want to be a social drinker, fine. You want to smoke an occasional joint, probably not going to kill your gains. But use common sense.
Sorry if you wanted a more specific answer, but there are literally dozens of answers that can be given, and unfortunately it's not that clear if there is one superior answer.
Mark Rippetoe's Texas Method
Jim Wendler's 5/3/1
Joe DeFranco's Westside for Skinny Bastards
Dan John's One Lift A Day
Dan John's Mass Made Simple
Christian Thibadeau's many programs on this site
(others may chime in here as well)
...to give yourself a rounding of what's out there. Then pick one that sounds best to you, and do it.