Find stuff that keeps you both challenged and engaged. If you're engaged you're more likely to keep it up. Now, what keeps one engaged in a workout can be (and is usually) different from person to person. So, try using all the equipment in the gym over a short period of time and find what works for you. You may find the elliptical does it for you. Or the bikes. Or the treadmill/running. Or just lifting. Or a combination of any number of stuff. Also, make sure to mix up your workouts on a pretty regular basis. That way your muscle-memory stays confused and doesn't become complacent.
Don't skip leg days.
When lifting, proper form and a lower weight is waaaaaaaaaaaaaay better than shitty form and more weight.
Wipe down any/all equipment you use. Don't slam the weights down. You won't look cool and you'll just let everyone know you're a douche.
Don't be afraid to ask anyone for help and/or advice. While most people in the gym just wanna get in/get out, most are still willing to chat and give advice/tips, if asked.
Stretch.
Stay hydrated.
And like Russ said, diet is a big part of it all too. I'd suggest doing a food/fitness journal (myfitnesspal for example) and religiously tracking your calories/fat/protien/carbs/etc. intake to start. Eventually you'll start to know how much nutritional value the foods you eat have and know what to cut down on or cut out or eat more of. Of course, the everything in moderation mantra also works. Also, don't shy away from some carbs/sugars. Some fruits/veggies can have a fair amount of either in them but they're the "good" kind. Drink lots of water too. Have a cheat-day here-or-there too.