There’s a good chance you’ll gain weight if you indulge in a few too many comfort foods or stay away from the gym for too long. But if you have hypothyroidism, the numbers on the scale can creep up, even if you’ve stuck firmly to your diet and exercised religiously.

The hormones your thyroid gland releases help regulate your metabolism, or how efficiently your body burns food for energy. When your thyroid makes less of its hormones — as it does in hypothyroidism — your metabolism slows down. So you won’t burn off calories as quickly and you’ll gain weight. The weight gain usually isn’t extreme, maybe 5 or 10 pounds, but it can be enough to affect your self-esteem.

The more severe your hypothyroidism is, the more weight you’ll gain. Some of the weight gain is fat, but much of it is fluid buildup from the effects of an underactive thyroid on your kidney function.

One way to manage weight gain is by taking the thyroid hormone medicine your doctor prescribed. A daily dose of levothyroxine (Levothroid, Levoxyl, Synthroid) will restore healthy thyroid levels, and with it, your metabolism. Once you’re on the right dose, your weight should stabilize, and you shouldn’t have any more trouble losing weight than anyone else.

Thyroid hormone might not rid you of any weight you’ve already put on, though. To get back down to your original weight, follow a sensible strategy that combines diet and exercise.

To trim down, start by subtracting calories from your daily count — but do it safely. Don’t go on an extremely strict, low-calorie diet. Your body will only hoard calories, and you’ll end up gaining weight. Instead, you want to find a balance between the calories you take in and the calories you burn off each day.

A safe goal for weight loss is 1 to 2 pounds a week. On average, eat 500 fewer calories each day and you’ll lose about a pound a week. Cut 1,000 calories a day, and you’ll lose 2 pounds a week.

One easy way to trim those calories is to eliminate all the foods you don’t need. Cookies, cake, sodas, and candy are all full of empty calories. They’ll make you gain weight without contributing any nutrients.

Instead of dessert, eat a bowl of fresh fruit sprinkled with no-calorie sweetener. Replace soda with sparkling water and lemon. Switch out foods made with processed white flour, like white bread and crackers, for those made with whole grains.

Another way to trim calories is to eat more energy-dense foods. These foods contain fewer calories per bite. They’ll make you feel full faster and stay full longer.

For example, have a bowl of vegetable soup for lunch instead of pizza. The soup has fewer than 100 calories and is high in water content, so it will fill you up. A slice of pizza has nearly 300 calories and is high in carbs, which your body will burn through quickly and leave you wanting more.

Center your meal around fruits and vegetables, which are low in calories and packed with nutrition. Add in a lean protein source, like fish, poultry, or tofu.

Of course, talk to your doctor before making any significant adjustments to your diet. You’ll want them to help guide and monitor you through the process.

Exercise is the other essential component to any weight loss plan. Regular exercise turns your body into a more efficient fat-burning machine. The more you work out, the more calories you’ll burn both with exercise and when you’re at rest.

To lose weight, do 300 minutes a week of aerobic exercise, like jogging, bike riding, or playing tennis. That works out to about 60 minutes a day, five days a week. If you don’t have a full hour at a time to exercise, break up your routine into 10- or 20-minute segments.

Pick an activity you love and that’s convenient for you, so you’ll stick with it. You can walk around your neighborhood each morning, follow a fitness DVD, or take a spin class at your local gym. Any activity that makes your heart beat harder and causes you to break a sweat — even gardening or mopping your floors — counts as exercise.

A daily workout will also give you more energy, counteracting the fatigue hypothyroidism can cause. Because an underactive thyroid can slow your heart rate, talk to your doctor before starting any new fitness routine.

Ease into exercise slowly, and only gradually increase your pace and workout duration when you feel ready. Again, ask your doctor about specific exercises and doing a set routine.