Some people find distractions useful in delaying or avoiding the urge to harm themselves.
UK charity Mind have some suggestions on their website which you may find useful.
Please remember that it isn’t failure if you try any of the suggested distractions and they don’t help. Different people find different things help them on the road to recovery.