The first part is great advice but unfortunately not always easy for those in small apartments where that space is precious.Yeah, I struggle with that for this very reason. I have one room in my apartment that was already my home-office / library where I would sit to work on my personal projects and what-not. Now with this pandemic inspired WFH situation, it's just the best place in my apartment to carry out my normal work day. It's also still the best place to work on my own projects or just sit and study. Sadly that means that A. I wind up spending way too much time in here, and B. change of room isn't much of an option in terms of demarcating the boundaries between "work time" and "my time".
But if I close down my work laptop, go take a bath (see other comment), and the later come back in this room with my personal laptop, I get a pretty good sense of having transitioned from one mode to the other.
Doesn't help with the sense that I spend too much time in this room though. I gotta get back into bike riding more again or something, to have an excuse to spend more time outdoors.