Hi and welcome.
The absolute best way to put on mass is, obviously, using anabolic steroids but I'm not going to recommend that because they can be harmful if not used wisely and I'm not here to recommend substances anyway.
I will recommend though that you choose a BEGINNER full body lifting routine (think Starting Strenght, ICF 5x5, Stronglifts etc.) that you will do 3 times a week.
These routines should be done until you cannot progress on them anymore (cannot add weight on the barbell every workout after having deloaded a few times) but you can also change routine after a few months if you don't like them. Just don't change routine every month.
The routine you choose also depends on your goals, I'm assuming you want to look good so I would begin with ICF 5x5 (Google it) and then switch to a split like PPL (push pull legs).
Remember that form (lifting the right way) is very very important if you don't want to hurt yourself, watch lots of YouTube videos and film yourself/ask other experienced people at the gym.
Another extremely important thing is the diet, you have to eat at a surplus (more calories than you body uses to function), you need to calculate your TDEE and eat ~500 calories more than that.
You also must get plenty of protein (protein is what the body uses to "repair" the muscles after heavy strain to make them bigger and stronger), aim for ~0.8-0.9 grams of protein for lb of bodyweight, more isn't necessary but it doesn't hurt.
If you need any help or explanation of what I've written above feel free to PM me, good luck
