Bill Gates, billionaire and co-chair of the Bill and Melinda Gates Foundation, in Washington, D.C., U.S., on Thursday, March 26, 2015.

Habits and routines are powerful. They help us every day, freeing up brain space and releasing us from making countless decisions. But not every habit is good, and not breaking a bad one can hold you back from success. If you're struggling to overcome certain vices, take some inspiration from Bill Gates, Elon Musk and Mark Cuban. The three billionaires are successful now but have all had to quit common bad habits over the course of their careers.

Bill Gates the procrastinator

Find yourself putting things off until the last minute? So did a young Bill Gates. The Microsoft co-founder was a heavy procrastinator during his undergraduate years at Harvard University. (Gates dropped out after two years.) "People thought that was funny," he told students at the University of Nebraska-Lincoln's College of Business Administration. "That was my positioning: the guy who did nothing until the last minute."

The now-billionaire received a sobering reality check when he entered the business world, where deadlines must be met and timeliness is prized. "Nobody praised me because I would do things at the last minute," Gates said. As a result, he tried to "reverse" this habit and become more like the students he knew in college "who were always organized and had things done on time." He's still a work in progress, Gates says, but admits that "procrastination is not a good habit." If you find yourself getting side-tracked at work, try this tip from "Shark Tank" star Kevin O'Leary: Stick to a set schedule. "Prioritize every 15 minutes of your day," he advises. Also ask yourself if what you're doing is making you money. "That makes it easy to snap out of it," says O'Leary.

Elon Musk the caffeine addict

The Tesla founder recently copped to working 120 hours a week, leaving little room for shuteye. To compensate for this sleep deprivation, Musk used to drink large amounts of caffeinated beverages. "There were probably times when I had like eight [diet cokes] a day or something ridiculous," Musk told the German automobile magazine Auto Bild in 2014. "I think these days it's probably one or two, so it's not too crazy." He also struggled with a coffee addiction. "I used to have so much coffee...that I'd get really wired," said Musk. "I'd get over-caffeinated and it wouldn't be good." Health experts say that consuming too much caffeine can increase anxiety and stress levels and creates a toxic cycle of fatigue, which leads to increased coffee consumption, which impairs your sleep, which leads to more fatigue the next day, which leads to more caffeine consumption. Instead, take a page from Musk and swap out a daily coffee for some good ol' H2O. If you can't quit cold-turkey, slowly decrease the amount of caffeinated beverages you consume each day.

Mark Cuban the bad communicator