One of the keys to being more productive while working from home is to ensure your day is structured and you have allotted time slots for certain tasks, breaks and distractions (yes you did read that correctly, distractions).
When trying to structure your day, always allow more time than you think you will need for big tasks. This can then allow for your mind to wander, as it does naturally, throughout the day. When trying to decide upon a time for your major tasks, try and think about when you are most productive. For me, it is a window between 9:30 and roughly 11:30 in the morning.