The hard task
Meditation helps in two ways:
Firstly, meditation can help us gain the self-knowledge we need to fully identify our habits, weakness, and blind-spots. The more we understand, the more we can prepare for. One study  has shown that particularly Vipassana meditation, is a particularly effective treatment for alcohol and substance abuse. Centered on the showing impermanence of thoughts, this technique of meditation helps to see the true passing nature of cravings, and ultimately prepare us to let go of them. Often when we feel a craving for something we only look outward, but by helping us look inward meditation can neutralise that craving before it takes hold of us.
The core of the problem
Secondly, meditation helps us take control of our thought processes and redirects them away from triggering trajectories. During the grip of craving, there is always emotion at the center – frustration, anger, sadness, and on. One review of 14 studies  has shown that meditation helped control binge-eating by helping sufferers control their emotions significantly better, thus relinquishing them from the grip of their cravings. The same result was found in recovering alcoholics, who found that meditation helped them control the stress-related cravings significantly better than before. 
A better form of comfort
As well as the mechanics behind controlling addiction, the reality is that dealing with addiction can be really tough and also quite isolating. Meditation will strengthen up your mind, but it will also introduce you to a wealth of resources from a community of people who understand that sometimes your mind can sometimes seem like it’s against you but if you have the right support and guidance there’s nothing you cannot overcome.
At the beginning meditation can offer you an instantaneous momentary relief from the grip of craving, and but the real benefit is that meditation could be the tool to bring your addiction to an end.