Detox is simply the task of cleaning your body from the substance you are addicted to. Today this does not have to be painful and will take as little as 3 days or as long as 21 days.
After detox the physical craving will be removed but you will still probably have a strong physiological craving and will need to go through addiction treatment to become completely free of your dependence.