Calories in vs calories out, use a weightloss calculator to find out how many you burn daily and try to exceed that by 300-400 calories a day, that's an extra lunch!
When I was bulking a few years ago I'd start every day with a milkshake (heavy cream instead of milk) and a scoop of potential powder, it was about 900 calories and as a drop in replacement for breakfast it works to help gain quick!
MAKE SURE YOU WORK OUT
Using methods like this are fine but you have to ensure you're getting your nutrients, add vitamins or smth, and work out so you build more muscle instead of just storing fat.
If you are struggling with being underweight, you could try one of these meal replacement drinks, since it's easier to drink calories than to eat them. I am not a medical professional tho, so take this with a huge grain of salt and see a doctor first, if you can.