My job makes things more difficult

I’m a detective who investigates a lot of sex crimes. After all the stuff I’ve seen, sometimes I’m just not even remotely interested in having sex with my wife. Like it’s the last thing I want. And other times when I’m trying, it’s hard to stay in the moment and not think about all the awful stuff I deal with. Obviously, what the victims endured makes my issues pale in comparison. But the things I see and do take a toll. When I’m trying to stay in the moment, it’s like my brain shuts it down.

Is there anyone else here with a similar profession that deals with this? I love my job and I’m good at it and I think my work is important. But I don’t know how to disconnect all that stuff from the rest of my life.