That's a great question. I have been working from home for almost 30 years and it definitely requires a different sort of discipline than being in the office. Here are some suggestions:
1) Set up a designated work area that is not in the middle of where the family will be hanging out or watching TV. (A lot of people try to use the dining table and find it's a noisy difficult place to work). Make sure you have a desk that's the right level and a comfortable chair so you don't end up with a repetitive stress injury such as carpel tunnel syndrome.
2) Set designated times when you start and end work, just like you did at the office. Schedule breaks and take them at the scheduled time. During your working time, remain focused on your work and ignore or delay any distractions until after your work hours are over. (Unless someone is bleeding, of course.)
3) Train your family that when you're working, they should not disturb you. The standard we use in our house is that if you would not have called me in the office about it, it should wait until after I am done working.
4) Unless being on social media is part of your job, stay off of it during working hours. If you feel like you really must check social media, do it during your breaks and keep track of how long you are on it. A quick 5 minutes to check Facebook can easily turn into an hour of surfing around reading stories online.
Finally, while some people have trouble with distractions when working at home, others have trouble shutting work off and leaving it behind at the end of the day, or with stopping when it's time in order to ensure a work/life balance. That's why the designated start/end times are so important, and also why it's helpful to have your work life in a separate area of the house. In my case, I can literally walk away and shut the door, which is a visual reminder that I'm done working and need to let work issues go.
I'm happy to answer questions if anyone is having struggles or wants advice on how to make this work.