It takes a lot of self motivation and discipline.
You are not governed by a structure of having to be at work at a particular time and no one is supervising you.
Therefore it is all on you. You can sleep in, take a day off, get nothing done and watch tv all day if you want; or you can put your head down and get the work done. We associate our home with the place we relax, so you have to learn to set yourself work times or a work regime and ethic. Sometimes having a work space, like a home office helps.
Also, home is filled with distractions. There are jobs to do etc.
If you have a partner or spouse, they think because you are home, you can do home related things. It is important to communicate and let them know that between certain hours of the day, you are working. Others often do not regard working from home as a real job.
Depending on what work you do from home, it can take time to get income and see results, and when things go slow, it is easy to get discouraged and want to avoid working for a day.
Not everyone is able to work from home. Some work better in a supervised or structured environment.