How can I gain weight

Hello! I’m 24 and my weight is 42kg and ny BMI is 18. I have gastritis and it means some foods or drinks is not allowed for me to eat. But I eat alot. I do sports too. But I want to gain weight so I can donate blood and of course dont want to be thin. Can you helpe what I need to do? Thank you very much.