Consult a nutritionist for a proper diet to gain weight.
The most important thing you can do to gain weight is to eat more calories than your body needs/burns. Eat lots of protein, lots of energy dense foods like nuts, dry fruits, grains and meat. You can do weight practice also. Lift weights and improve your strength. You can try weight gainer shakes also. These things will help you to gain weight.
Here are some healthy ways to gain weight when you're underweight: Eat more frequently. When you're underweight, you may feel full faster. Eat five to six smaller meals during the day rather than two or three large meals. Choose nutrient-rich foods.