The key is to have different computers, or at a minimum different user accounts. On the work computer no private stuff, on the private computer no work stuff.
Once I've logged out of my work account it has never happened that I'd log back in the same evening, open the VPN, restart the browser etc just for a quick check of emails or chat messages.
It's a bit challenging in academia, where many of the students send their messages later in the evening. I've made it a habit to not respond after 6pm for that exact reason - if they see I'm "on" then its okay to communicate. However the past year has reminded me about the reasons I started making YouTube videos and whatnot, because I DON'T want to be bothered outside of class and so my students have all the resources available when they choose to work on my course.
Some of this is a 'me' problem, needing to remember to disconnect from the world and all of the literal fires going on. I've been using the hyperbole that essentially my brain "exploded", so I deleted Reddit, been on an unsubscribe phase with my YouTube channels, and joined some smaller communities. That last one still keeps me online, but I look at as smaller community means silly memes and a group of people that eventually clock out for the night.
It's so much more quiet! I missed this.
One key for me is to have a separate desk. My work machine is in its own corner where only work things can happen. The physical separation makes the habit that, “here is where I work” vs “here is where I live”.
I don't really have space for two separate computer desks. But I enforce the divide with pants: work hours means work pants, the same I'd wear to the office, and after work I "commute home" by changing the pants.
It's a stupid thing but I started doing that at the beginning of the pandemic lockdowns and have kept it up ever since.