As a kid, I always wanted to be an entrepreneur. There was just something about it that was so enticing. Having the freedom to make my own schedule, work on the projects of my choice, and help people in a big way — it was everything I ever wanted. That dream was cut short when my parents urged me to go to school and study to become a doctor. And for years, I stuck with that.

But almost five years ago, I discovered search engine optimization, or SEO, and I’ve been doing that ever since. I started Webmetrix Group, helping companies manage their web presence and drive traffic to their sites, and quickly grew it to a 7-figure business.

Work was busy, but our financials were doing well and our clients were happy. By every measure, I was living the life I always wanted to as a kid: I ran a growing business and married the love of my life. She meant everything to me, but when our relationship began to slip, I realized that my actions were far from lining up with what I claimed mattered in my life.

At the time, I was at a crossroads. I thought I could only choose one thing between my marriage and my company, so I chose my marriage and worked on turning it around. My company’s performance took a huge hit, but I thought that was the cost of keeping what mattered most to me. Years have passed since, and with business and my marriage doing better than ever before, I’ve realized that it is possible to run a successful company and not be miserable doing it. Thinking back, there are seven lessons I learned that should be helpful to any entrepreneur.

1. Limit travel whenever possible

Back in the day, I used to travel all the time to meet with clients and prospects in-person. I thought (and still think) that meeting with folks in-person is the best way to get the ball rolling, but that doesn’t mean doing so is the best decision for your personal life. Being away from home all the time meant that I had to trade face-to-face interaction with my wife with face-to-face interaction with clients. I claimed to value my wife far more than my business, but my actions showed the exact opposite.

Fortunately, with the advent of video-conferencing technologies like Zoom and Google Hangouts, traveling isn’t always necessary anymore. Of course, there were times where I would meet with a prospect across the country and end up not closing the deal. Failures like those are much more productively handled over video chat, not to mention far lower-stakes. Clients that saw the value in the services I provided were still interested in working with me despite not having met in person — and existing clients were far more comfortable meeting virtually than meeting in-person for the same reason. Overall, doing meetings online was a complete game-changer in allowing me to spend more time with those I love.

2. Communicate openly about difficulties

In my journey, some of my clients would opt for higher-end services as they scaled, employees would leave for higher-paying jobs, or I’d be turned down by prospects for one reason or another. I let these difficulties get to me. But at the same time, I never wanted to talk about them, especially not with my wife. Told not to project my problems onto others, I often kept my difficulties to myself. Looking back, I can unequivocally say that open communication is more important than you can ever imagine.

Part of marriage is helping one another get through tough times; those times help you grow closer, but that’s impossible if you don’t communicate. Regardless of how close you are with your significant other, he or she can’t always read your mind. That’s why talking about your challenges might be difficult for both parties, but in the end, it helps deepen your understanding of one another and why things might not be working out at the moment.

3. Avoid unhealthy coping mechanisms

When the challenges start to weigh you down, it’s easy to adopt unhealthy coping mechanisms — escapes, so to speak. Maybe the biggest difference between being an entrepreneur and working in the corporate world is that your failures can basically only be attributed to your mistakes, and that’s a tough pill to swallow. That means that entrepreneurs need to be far more accountable and avoid delusional thinking and practices that don’t change the outcome.

Though coping mechanisms like meditating have been recommended by many successful entrepreneurs, drugs and alcohol are examples of practices that entrepreneurs should avoid. We’ve been told this since our days in grade school, yet too many entrepreneurs resort to these measures to avoid thinking about their problems, which don’t just magically go away.

4. Think deeply about forging a healthy company culture

Speaking of retaining employees, you have to realize that building a company often means that you’ll be spending more time with them than even your own family. And that’s why having a team that is hardworking and deeply aligned with your mission, but also kind, iscritical to your business success.

The people you hire are far more than the sum total of the work they produce. The right hires will make your job a lot more stressful, both because they bring tremendous value and the spirit to keep you going. On the flip side, the wrong hires can put a dampener on both your company and personal growth. Forging a healthy company culture isn’t easy (and a highly volatile task in the early days), but if you’re able to pull it off, the payoffs can’t be understated.

5. Don’t make compromises on family time

With the freedom to set your own schedule as an entrepreneur also comes the challenge associated with not having a fixed schedule. Often, when your clients call, you pick up, regardless of whether it’s date night or you’re on vacation. After all, your clients are your first priority, right?

Though it’s true that you should be happy doing what you do, there has to be a boundary between your work and spending time with your loved ones. When you’re working, your clients should certainly be your number one priority. But when you’re on vacation or dinner, there shouldn’t be any room to compromise. With a finite amount of time in your day, you shouldn’t be a sell-out. You shouldn’t always assign a value on your time because then you’d no longer have the freedom you wanted in the first place.

6. Learn to say no to distracting opportunities

As you continue to scale your business, the number of opportunities will only continue to grow. And with that, one of the most important skills you could ever have doing business is being able to pick out the good ones from the bad. That’s because not being able to say no to distracting opportunities could weigh you down far more than you can ever imagine.

Warren Buffett agrees with this idea. Just imagine what would happen if Buffett would talk to anyone who wanted an investment opportunity from Berkshire — he’d literally have no time left.

7. Optimize for what you enjoy instead of money

Lastly, and possibly most importantly, I’ve learned that optimizing for financial success is highly overrated. Though it’s true that money can solve a lot of the problems in your life, it can also get to your head and make you forget about all the other things that matter to you. At first, when I was growing Webmetrix, I wanted to work with any client that wanted to pay me, regardless of who they were. I auctioned out my time to those above a threshold — and honestly didn’t enjoy some of the projects I took on.

That left me with a sense of emptiness. Doing what you hate isn’t at all sustainable, and also was the prime reason I burned out. Working long hours is standard as an entrepreneur but coupling that with doing a bunch of stuff you don’t enjoy makes those hours extra miserable.

The way to avoid that is simple, but far from easy. You might lose out on client work you don’t enjoy, but the payoff from working with those you are genuinely invested in is incredible. Remember: Your career is a marathon, not a sprint, so optimize for a career you enjoy and actually want to do for the coming years.

Originally Published on Business Insider.

More from Business Insider:

Alexis Ohanian has taken out billboards for wife Serena Williams, but he says a simple Sunday morning ritual means more to their relationship

An organizational psychologist has a sneaky job-interview question to figure out what it’s really like to work somewhere

Melinda Gates has some great advice on how working parents can reduce stress

Follow us here and subscribe here for all the latest news on how you can keep Thriving.

Stay up to date or catch-up on all our podcasts with Arianna Huffington here.