Don't lounge around in your pajamas. Treat it like a real job.
Create a space exclusively for work that is removed from distractions, just like you would at your office desk.
Create boundaries within your home that your family members understand when you're 'at work.'
Bookend your day. If you can't enter and leave a physical office that creates more precise boundaries, use psychological transitions like a 20-minute coffee in the morning, then exercise right after work.