Aside from the obvious (wear headphones, keep work area away from common areas) something else we did was set a boundary limit. If I was in the bedroom, that was now the “office” and was to be treated as such. This one is more personal but I tended to get too annoyed at the interruptions at first without realizing that I needed to make more effort to help and not be (to put it bluntly) a dick about it. My girlfriend started getting in the habit of tidying up or doing crafts during her downtime instead of coming to me after we discussed the huge amount of distraction it caused.
Ultimately though the living situation is what made it hard. We were in San Diego, in a cramped two bedroom apartment that had no privacy. We moved and bought a house where I now have a large upstairs loft area as my office. That is absolutely not the answer to everything but I think some of the issue is just most people not being prepared or having the right accommodations.
My advice sucks but if you have any specifics I can try to help out and answer more. It’s hard but hang in there if you feel it’s just a rough spot.