If the goal is to just gain weight, all u gotta do is eat more calories than you lose in a day. A steps/fitness tracker can help.
If the goal is to also gain muscle, go for high protein foods like red meat, beans, eggs and work out.