As far as eating is concerned, here's what I suggest:
- Figure out what you usually eat.
- Now figure out what you need (in terms of proteins, vitamins, minerals etc..), and figure out whether your current diet is providing what you need.
- If you have been getting everything you need in your current diet but are gaining fat, figure out what you can start cutting back on.
- If you are deficient in your daily intake nutrients but are also gaining fat, then figure out what you can add to your diet to complete the right nutrient intake, and what you can start cutting back on.
All this diet and exercise shit is a bit evolutionary. Just stick to it, build it up over time. Don't be too hard on yourself but don't give up or go easy either.