When we help athletes put on weight, the first requirement is to NOT skip meals or snacks. I have worked with football players who have their first meal at 2pm and wonder why they are not gaining mass. So, breakfast, snack, lunch, snack, dinner, snack. Also, while you don't need to eat a lot of unhealthy junk, you do need to concentrate on what nutritionists call "energy dense foods." Technically, this means lots of kilocalories per gram of food. These are things like nuts, nut butters, avocados, vegan cheese, etc., and you need large portions of these and all foods. Some people find that drinking calories (ie smoothies) is easier than chewing all that food. The idea is to take in a lot of calories without clogging your arteries. If necessary, you can also try engineered foods, (bars, GUs, shakes etc.) though add those in additional to whole foods, not instead.
Also, since you want the weight to be muscle tissue and not fat, you must engage in progressive, significantly challenging weight training for hypertrophy. If you’re new at this, get the help of a certified fitness professional.