One key to working from home without getting distracted is for you to have a "work spot" that you regularly use; it is easy to get in the (often bad) habit of moving around your house to whatever spot is most comfortable, but it is much better to pick a spot that is designated as your work spot - and to use this spot for work, and for nothing else - as this will put you in the proper mind for accomplishing work when you sit down in this spot.
You should also realize that you will usually take breaks from work when you are working in an office - either to get up and walk around, or to chat with someone else, or to get coffee, or to simply give your mind a break - and you should make sure you are still doing this when you are working from home; if you do not give yourself breaks from work, it will be easy for you to get burned out and start to lose focus, but with regular breaks, you will be able to work much harder during your work time.
And sometimes, when you are working from home, it will be impossible for you to fully focus, no matter what you try doing; when this is the case, it is often helpful to get out of the house for a bit - either for a break, or to work from some place else!
As you keep these tips in mind when you work from home, you will be able to enjoy all the benefits of working from home, while also getting good work accomplished.