Protein - chicken is great. Beef, pork, and fish also have protein but don't go overboard. Eggs are good but if you're eating a lot of them cut out some yolks cause it's bad cholesterol. All natural peanut butter is good and so are nuts like almonds. Green leafy vegetables also have protein and being lower in calories you can eat a lot and it'll fill you up without a ton of calories. Protein shakes are great after a workout (buy the powder and mix it in milk or water).
GOOD fats - all natural peanut butter, nuts, olive oil (you can use olive oil and vinegar on salads instead of dressing), fish oil, things like that. Read the labels and avoid as much saturated fat as possible. You're going to get a little but if it's got more unsaturated fat than the other you're generally okay.
Carbs - oatmeal, whole grain beards, and brown rice are all good but if you're trying to lose weight don't eat a lot of them. All sugars are carbs. You want more Complex Carbohydrates than simple ones and sugars. A quick breakfast is ground up raw oatmeal mixed in a protein shake. Clean carbs and protein to start the day.
You've gotta count calories and grams of everything if you're really serious and strict about it. Most diets that maintain weight are 2000-2500 calories a day. If you want to lose weight drop to 1800 and increase activity. You can go a little lower, maybe 1600, if you aren't losing 1 pound every other week. You don't want to lose more than 1.5lbs per week so if you're dropping more weight than that increase your calories.
I forget the ratios but I think for weight loss you want 40% of your calories from protein, 40% from fats, and 20% from carbs. This is where counting and reading labels is up to you.
To GAIN muscle mass you need to eat a lot while doing a lot of exercise and weight lifting. You'll want to eat your body weight in grams of protein per day. So if you're 175lbs eat 175g of protein. Plus you want a lot of good fats and eat clean carbs. You'll also be eating 3000 calories a day or more. Hit the gym 4-6x a week and switch up muscle groups. They need 24-48hrs rest before working the same muscles again so they can rebuild.
I think that covers a lot of it.