"How can I stay lean, lose fat, and build muscle?"
Take it slow. I advise focusing on one thing at a time.
Diet or exercise? Focus on one. Whatever it is, don't skimp. If you're going to focus on diet, do something like, okay, I'm going to eat healthy X amount of time and allow myself to indulge X amount of time. A good rule of thumb is 66/33; in other words, two of your meals are healthy, one of your meals is whatever you'd like. It must remain a portion size, though, so not an entire pizza from Pizza Hut but one slice.
You may think it sounds easy, but in my experience people want to go 90/10 for a week or two. Then they binge due to cravings and fall off the wagon.
If it's exercise, again, be consistent. Set ground rules. 'I'm going to work out five days a week for 30 minutes.' Or 45 minutes. Or 15 minutes.
Do it right; this is a lifestyle change.
Stretching is more important than anything; there's nothing wrong with starting with just stretching and light cardio for a couple of weeks. Dynamic stretching before, static stretching after.
Personally I suggest something like:
Month 1: Light cardio. Learn dynamic and static stretching routines. Find out which ones you like. Should be about 30 minutes total. Take your time. For me stretching isn't something I enjoy; it's something I learn to enjoy. You will become in tune with your body. It is very exciting! Focus on your breathe. When you're doing static stretching, as you exhale, extend the stretch a tad bit. Breathe in, exhale, extend very slightly. I guarantee you will see improved range of motion very quickly.
I like to focus on stretching my back, legs, hands and feet the most. You'll find your own preferences.
Month 2: Up the cardio. Depends on your fitness level, of course, but let's say you're an average American. For the first month you walked 20 minutes a day, 5 times a day. For month two start light jogging 2-3 times a week.
You will begin to feel quite limber and energetic, assuming you've been consistent.
Month 3: Regular jogging and stretching. A mile a day five times a week will be a breeze.
Jogging may not be for you; maybe you prefer riding a bike. Jump rope. Basketball. Don't be afraid to experiment, but at the same time, recognize that this will probably be something you have to learn to enjoy.
It takes 22 to 30 days to make a habit. By this time your habit is certainly ingrained. You have experienced strong positive feedback every step of the way. The quality of your sleep has improved. You've made slow and steady improvements and it's now obvious, both to yourself and to everyone you run into. Now you can slowly add improvements in to your diet.
I think the hardest things to change are the things you've been doing the longest. What do we spend the most time doing? Sleeping, eating, talking, thinking, and moving. These are all extremely difficult habits to change; our brain is wired to find comfort in whatever we've been doing for a long time. Your brain does not discern between "right" and "wrong"; to it, anything you've been doing for a long time is right. Therefore you will face resistance. The quicker you try to create change the more resistance you will face, and the more negative feedback you will incur upon failure.