Having a dedicated "office" space in your home helps a lot with that environment separation. If you have kids, that space needs to have a door that can close, too.
Don't work in your pajamas on the couch, that's the worst thing ever for your mental health.