Obviously, to gain weight, eat more, and to make it muscle, do resistance training of some kind in a careful way, but gaining weight in an unhealthy fashion will come back to haunt you later. I think you need to read up on
nutrition -- there's so many theories out there, it's good to see what several people have to say and divide by two.