The practice to handle desire
To confront desire, there are two practices: 1) of the relative truth; 2) of the ultimate truth.
Practice of the relative truth
There are two methods: contemplation on the impurity of the body and contemplation on impermanence.
1. Contemplation on the impurity of the body
There is quite a selection of teachings on this method in the Theravada tradition, which offer ways to restrain desire. Here is a simple explanation of this practice.
First, calm your mind and then contemplate: The root of all the pain that I feel from a failed relationship is nothing but desire. My desire for the other person makes me suffer; without this desire, I won’t be so heartbroken. It is actually my mind that’s making me suffer. I am the one who hurts me the most, not somebody else.
~ Depicted from "THE HANDBOOK FOR LIFE"S JOURNEY : On The Three Poisons - How to Handle Desire"