I've learned to sit with it. The more you try to not think about it, the stronger it gets.
So I let myself feel the craving, and I just let it happen. I remind myself a craving is unpleasant but not dangerous.
A craving cant control my limbs or body. It cant make me do anything.
A craving cant Harm or kill me.
So I get on with whatever Im doing and wait for it to pass.
Its taken a lot of practice to get to this point though!