How to gain weight for underweight person?

See Dr., then eat... If one is truly underweight (based on height, family background, and body type), a Dr. can evaluate for a hormonal, digestive, or other disorder. If no medical cause is found, then one can add weight by eating more calories of nutritious foods, while also doing weight-training to increase muscle. Proteins: egg white, chicken breast, salmon... Better fats: olive oil, peanuts, almonds, tofu...
Depends on cause! We need more info! Have you always been underweight? Do you get enough food? Do you have any medical problems? Do you make yourself vomit? First, get an examination and appropriate testing by your doc to be sure you don't have a physical reason for being underweight. Otherwise, you may just be thin due to heredity/genetics - & 99% of the plump world will be extremely jealous: including me!