All the things that make working from home great also make it risky. Not having to commute adds time -- sometimes hours -- to your day, for example, as long as you don't waste those hours. The same is true for all the freedom that being home-based offers. It's potentially rewarding, but also comes with risk.

Succeeding when you work from home requires that you impose some discipline on yourself. This is especially true if you work from home and aren't held to traditional office hours, and it gets even harder if you're self-employed.

No matter what your exact situation is, you need to create structure. It's OK, of course, to violate your own rules and break that structure, as long as you know what you did and make up for it.

A woman works on a laptop.

It's important to have a proper workspace when you work from home. Image source: Getty Images.

1. Know your goals

As a self-employed freelance writer/podcast contributor/various other things for Motley Fool, I am paid based on how much work I produce. Because of that, I use earnings, not hours, as my daily goal. Sometimes I hit that number well before I have put in a traditional eight hour day. That gives me the flexibility to call it a day or bank extra work to offset potential problems or opportunities that might happen later in the week.

If you're paid hourly, you might set your goal as putting in eight hours a day, or maybe working 10 so you can take a day off. No matter what your goal is, you have to know what it is to be able to achieve it.

2. Make it clear you have a job

Working from home comes with tremendous flexibility. I can let in a contractor or sign for a package, two things that are convenient and don't take much time.

I can also go shopping when stores are empty and make doctor's appointments at any time of the day. These are wonderful benefits, but they lead to other people wanting to make choices about your flexibility. Yes, you have a lot of freedom, but spending a few hours volunteering at your kid's school or picking someone up at the airport has consequences -- you either make less money or have to work other hours to catch up.

Make it clear to the people in your world that working from home does not mean not working. Use your freedom if you want to, but make those decisions yourself. Don't let others make them for you.

3. Make sure you have proper work conditions

I'm guilty of working on the couch with ESPN on in the background. That's reasonable for part of my day, but it's an unhealthy way to operate that leads to back pain and other problems.

It took some scolding from my physical therapist to force me into proper working conditions. I no longer go from my couch to the coffee shop (which has chairs not built for hours of work). Instead, I'll spend a casual half hour to an hour on the couch, pick up a coffee, and then head to a real desk at a coworking space. After a few hours there I walk back home, have lunch, maybe take a quick swim, and then work from a desk with a carefully selected chair in my home office.

Stay on target

Once you establish a routine and a rhythm it becomes easier to make exceptions. Working from home means you have to hold yourself accountable. You may have a boss or employer, or a whole lot of them if you're a freelancer, but being at home isn't the same as working in an office. You need to set your standards and learn what you have to do to achieve them.