I am at the age of 27 year old but I still only weight 40kg, I have tried everything to improve and gain weight, but nothing has work. Please help?

Diet and muscle mass. First, we need to know how tall you are--if you are seriously underweight you should see a doctor first. In general, to gain weight you need to consume more calories than you burn. Do this in a healthy way. Make sure you get all of your essential nutrients in calorie-rich food. With weight training, you can increase your muscle mass. A doctor and nutritionist can help you with a specific plan.