If you have a hard time keeping and maintaining good habits, you may be thinking "too big," according to a Stanford University behavior scientist, who has been studying how habits are kept for nearly three decades.

The key to success, he says, is to think small when wanting to develop new behaviors or routines.

"Tiny is mighty," BJ Fogg, Ph.D., who founded Stanford University's Behavior Design Lab tells CNBC Make it.

Since 1998, Fogg has been conducting studies and running the Behavior Design Lab to figure out how habits are formed and, more importantly, how to make them stick. He has also privately coached more than 40,000 people for his research.

"It's all about baby steps," says Fogg, author of the new book, "Tiny Habits: The Small Changes that Change Everything."

Fogg says he found that most people aim too high and big when trying to form a new habit — which often leads to them to fail. For instance, if you have a goal of drinking a gallon of water a day, the key is to start with having a sip after you wake up in the morning, says Fogg. By taking tiny steps to start, Fogg found that people are more likely to keep that habit because the new behaviors don't require a lot of motivation at first. And there's no need to create an elaborate plan or rally social support. It's also safe to experiment with because if you don't succeed, the "misstep is tiny."

Additionally, he thinks it crucial to start a new behavior following something that is already a staple in your routine (like brushing your teeth).

"Every behavior needs a prompt to occur. Your existing routine can serve a prompt in a powerful and elegant way," Fogg says.

Lastly, to make something stick permanently, it's important to celebrate after completing the habit.

"Give yourself a fist bump," Foggs says. By congratulating yourself after completing the habit, you will be more likely to repeat it, according to Fogg's research.

Fogg says you'll eventually "do more of the habits in time that you hadn't planned and you'll also be less fearful to try to attempt other changes."

The habits people want to make part of their routine the most are around productivity, according to a recent study conducted by Fogg's team. Productivity beats the desire for habits that have to do with being financially secure and losing weight.

A good small habit for productivity, says Fogg, is putting your phone on do not disturb mode as soon as you sit down at your desk. When the habit takes hold, it will have a ripple effect and eventually boost your productivity, he says. That's because by doing small habits, you'll "be less fearful to try to attempt other changes."

"When you go tiny, you don't need to rely on willpower or motivation,' Fogg writes. "Tiny will grow bigger, just like a seed grows into a tree."

12 tiny habits that help people with productivity, according to Fogg's research

Fogg suggests saying these habits to yourself throughout the day. Each habit is connected with an anchor or prompt to help you remember to complete it.

1. After I sit down at my desk, I will put my phone on do not disturb mode.

2. After I close my office door, I will organize one item that's lying around.

3. After I finish reading e-mail, I will close the e-mail browser tab.

4. After I launch a new Word doc, I will hide all other programs running on my computer.

5. After I find myself mindlessly browsing social media, I will log out.

6. After I sit down at a meeting, I will write the title, the date, and the attendees at the top of my notes.

7. After I notice a call going on for longer than expected, I'll say this: "It's been great to talk, but I need to wrap up. What haven't we covered yet that's important?"

8. After I read an important e-mail, I will file it in a folder for the designated project.

9. After I read an e-mail I can't deal with immediately, I will mark it as unread.

10. After I read an e-mail that's time-sensitive, I will reply with this script: "Got it. I will review it in detail and get back in touch soon."

11. After I leave the office, I will think about one success from the day.

12. After I walk in the door at home, I will hang my keys on the hook.

Like this story? Like CNBC Make It on Facebook.

Don't miss:

Top execs use this visualization trick to achieve success—here's why it works, according to a neuroscientist

Neuroscientist: Skip breakfast sometimes and 2 other simple tips to boost your brain performance

I used a peak performance coach who worked with Google and Berkshire Hathaway—and it actually helped me