The effectiveness of working from home obviously depends on the nature of the work, and whether you need to work with other people on it, especially if you need help or you will be providing help to others. It also depends on how effectively you can set up a physical and mental environment for working at home (including a suitable location and the self-discipline to keep focus on the right things).
I've spent most of my life working on complex software design and development (writing middleware and systems software for IBM mainframes), which involves a lot of working on my own. For each project, I've usually been the lead programmer, and I have usually started by designing the overall structure then splitting it into chunks with well-defined interfaces, and passing the interface definitions to anyone else who needed to write code which would interface with my own code, so we didn't need to work together much. I also carefully write up the externals of anything I'm working on myself so that others in a team can work from that and the writers can incorporate the documentation into the official publications with minimal editing.
For much of that time I was in a one-man office and able to work very productively at work. When it became a two-man office, there were distractions and I found it necessary to spend some time at home, especially when working on deep design. When I got moved to open-plan, my productivity at work was impacted so much by distractions and interruptions that I could no longer do effective design and development work there (although it was much more fun socially), so I switched to working at the office only two days each week, mainly to attend regular status meetings and be seen to exist, but not to get much work done. I have always had a "study" at home for working (and for studying), where I could work with very little interruption even when the kids were young and the wife was at home looking after them. I also usually had very flexible hours, in that I had a project and an agreed schedule but if I felt I'd reached a good milestone for the day I could finish early.
Unfortunately I'm no longer in design and development. Because of my very wide experience in mainframe products, it seems I was the ideal person to be moved into supporting about a dozen older IBM software products (initially as a "temporary" job when a critical person was too ill to continue), and I'm now a member of a two-person team where I'm in the UK and the other person is in California, and we both report to a manager in Texas who reports to a manager in Toronto. There is now very little point in my going anywhere near the office (even though I still have a desk mainly to keep my extensive archives) as no-one else there is involved in anything related to the same job, so I only visit perhaps once a month or less. However, as work is very intermittent, I frequently end up with all current activities blocked awaiting action from others, or even no support work at all, and I really hate that. If it were up to me, I feel it would be perfectly fair to treat any time when I have no support work as free time for me to study physics or do some practice on the violin and piano, but management feel I should normally be making use of at least part of any time like that for "self-education" or similar, so for example I've learned the essentials of about 15 more programming languages, most of which I'm sure I'll never use (along with most of the 100 or so I've previously learned). As far as I'm concerned, all that does is prevent me using the time for myself, and I'm looking forward to when I can afford to retire.