If you are underweight, for which you and your doctor are the only people who can judge, you need to lift heavy and eat big:
1. Stimulate Growth
Either buy a barbell and a power rack, or join a gym that has one. Get a copy of Starting Strength and start lifting heavy. Compound exercises stimulate growth. Squats, chin-ups, deadlifts and presses will tell your body that it needs to get bigger.
2. Provide Fuel for Growth
Eat a ton of food. Real food is far superior to processed crap, but you'll need to eat a lot. Your best bets are high-animal-protein items like meat, eggs, milk, and fish. You'll also do well to take in a large amount of vegetables and good fats like coconut and olive oil, and avocado. Eating a lot of food will provide the raw materials your body needs to make you bigger.
If someone else cooks for you, you have a choice: 1) man up and learn to cook, 2) try to convince that person to change their cooking for you, or 3) remain undersized.