If you want to gain weight, eat more, preferably high calorie healthy foods (e.g. fatty fish (low contamination kinds), nuts, avocados).
If you want the gains to be mainly muscle (as opposed to mostly fat), do muscle building strength training exercises (e.g. pushups, pullups, dips, rows, squats, etc.). Sufficient protein intake will be needed.