How to detach yourself from a person without suffering so much

Lately, a lot of people talk about detachment. Apparently, it is fashionable to accept what has always been true. That we are all a complete orange, not half or less. Detaching yourself from a person, feeling, thing, job, or situation can be the most useful weapon to have a better life. At least it has worked for me. However, as a human being, I still make mistakes from time to time. I must say that learning to detach yourself is the most useful thing in the world, and I learned to do it that way.