This is the single most important easy way to get better and to gain more weight:
How many course meals are you eating? You ideally should be eating 3-4 course meals 3x per day, rotating the meals throughout the week with snacks between meals.
A simple reason you are likely are losing weight is because of nutritional deficiencies. If you supplement yourself with vitamins abcdek, tons of trace minerals, biotin, probiotics, etc. your body will find the resources it needs to recover and thus stop using muscle mass, bones, hair, other parts of the body for energy.