Opinions expressed by Contractor the contributors are theirs.

Entrepreneurship goes hand in hand with many things. Determination. Dream big. An embrace of failure and risk. And, in my personal experience: insomnia.

I’ve found this to be especially true for creators and scammers I know. Nighttime is often the time when you can work uninterrupted, especially if you have a day job. Once you’ve been in the groove for a few hours, it’s very hard to switch off. Endless to-do lists. And the roller coaster of excitement and discouragement that comes with running a business makes it especially difficult for your brain to shut down. I worked long hours as a securities lawyer early in my career and loved it. But, I never had a problem leaving stuff in the office…until I started starting my own business.

All of this to say: while I’m heartened to see so many people turning to entrepreneurship and the creator economy over the past few years, I also know firsthand that it’s a potentially challenging path. sleep. That’s why I’m interested in sharing my own journey here. I may not be an expert. But I’m a creator and entrepreneur who battled insomnia while scaling our business to hundreds of employees and tens of thousands of users. And although I still have occasional sleepless nights, I can say with certainty that my sleep is better than it has ever been. Here’s how I fixed the course (…mostly).

From thriving night owl to struggle and lack of sleep

I think I’ve always been a natural night owl. I was someone who flourished late at night in college – it wouldn’t be unusual to find me in the library, breaking my textbook at 4am. Even when I was developing my first online LSAT course, it wasn’t that hard to pull in long hours after my day job to get the job done.

But as my entrepreneurial ventures grew into a full-fledged business, my schedule began to change. I had stuff I had to get up for in the morning, people who needed me to be present and engaged at 6:00 a.m. meetings, and early morning flights to catch. Then my children arrived, and it added another layer of responsibility to my morning schedule. Suffice to say, I knew sleepless nights were no longer an option. But at this point, it was extremely difficult to change my habits and my wiring.

I would lie awake, staring at the clock, growing more and more alarmed. In the morning, I would be exhausted and exhausted. It wasn’t just uncomfortable being underslept. It affected my ability to do my job. Countless studies confirm it: when we’re sleep deprived, we’re less equipped to process information, use logic, spot mistakes… or even drive safely.

Relationships also suffer. Sleep deprivation makes moderating emotions difficult, and it’s nearly impossible to make connections and respond thoughtfully (instead of emotionally). More than once I had to apologize to the management team after a morning where I just wasn’t myself. That was no way to run a business…or live a life.

Related: Why entrepreneurs should never feel guilty about sleeping

Finally taking sleep seriously

Over the years I’ve learned both why sleep matterswhy we sleep by Matthew Walker is a must read) and how to conquer those nights when it seems unachievable.

My biggest revelation: acceptance comes first.

Sleepless nights are going to happen, and learning to be okay with that is so much more comfortable than fighting it. When I started my business, I was stressed about money, product-market fit, and feedback from our customers. My mind would spin so much that even if I went to bed at 11:00 p.m., I would still find myself wide awake at 2:00 a.m.

But eventually I realized that stressing about falling asleep was never going to help me get into the zone. So I started to accept that it would be a sleepless night. Jump out of bed for a walk (yes, even at 3am) or read a book, and try again in a few hours. (I also tried watching a movie sometimes, but that usually made things worse.)

Once I found acceptance, I was finally able to start taking more active steps to address the root causes of the problem. Although books and research have helped (I would also recommend Without Borders by Ben Greenfield or Dave Asprey super human), I really have my children to thank here. Routine is a big part of getting a good night’s sleep – and having kids forced me to ditch my busy nighttime schedule and establish a regular routine. Over the months and years, the nightly ritual of the bath-pajama story has helped slow down my own internal clock. I even have an alarm that goes off a few hours before I go to bed, to remind me to start entering the zone.

This extends to other critical interventions (although of course I’m not saying it will work for everyone). I have an 8:00 p.m. limit to eat; I avoid caffeine after noon; I cut out alcoholic beverages at night. In the bedroom, I blocked out even the smallest light sources to make sure it was as dark as possible. None of this is really rocket science, nor a panacea – but collectively these approaches have made a real difference.

This is the tip of the iceberg. There is a whole range of more elaborate biohacks for those looking for other interventions. For example, although it sounds a bit extreme, I have found that cold dips in the evenings help relax my whole system. And, they regulate my body temperature so I’m in the right physical state to fall asleep comfortably.

Related: A Good Night’s Sleep Starts With These 4 Morning Habits

The Reward of Prioritizing Sleep

I’ll be honest: it’s rare that I have a day where I do everything right. But most of the time, I do most of these things. And when I toss and turn, I can at least identify what I did – like drinking a double Americano at 3:00 p.m. Having this insight and these tools at my fingertips when I really need to get serious about closing my eyes has paid off.

For example, when we went public as a society. I was watching a months-long span of consecutive 12-hour days filled with meetings and an investor roadshow. Because I was equipped with the right toolkit to optimize sleep, I was able to get the right amount of rest to come to work ready to go.

Ultimately, I can honestly say that knowing how to sleep well has made me a better entrepreneur. And not just in the sense that I’m more creative or productive: it’s also dramatically improved my relationships with my wife, kids, colleagues, partners, team members, users, and investors. With a good foundation of sleep, I am equipped to deal with the inevitable (and healthy!) conflicts that arise during the day in the most productive way possible. Passionate debate is one of our core values, so being able to have the cognitive function, patience, and empathy to dig into issues in a results-oriented way is a huge reward for me.

For creators and entrepreneurs, I’ll offer one last insight. Getting a better night’s sleep also comes down to cultivating a healthier relationship with your business. Learning to unplug, step back, and maintain some semblance of work-life balance will allow you to better relax and turn off your buzzing brain at night. Although easier said than done, it’s this kind of perspective that sustains you in the long run. Sleepless nights and furious sprints can work at first. But a business built to last needs the sustained, focused energy that only a good night’s sleep can provide.

Related: 10 Ways to Make This Year the Year You Sleep Better