This is the problem with drug withdrawal - its never pleasant. Opioids will make you feel like you want to die - but it won't kill you. Withdrawal from alcohol, benzodiazepines and barbiturates are the only ones which can potentially kill someone if not undertaken correctly (the latter is rare now, barbs are never prescribed, except for phenobarbital for epilepsy, although this is still relatively uncommon in the UK).

Very generally and without knowing your history or dose:
To withdraw safely, you need to find the dose which "takes the edge off" - this will still be uncomfortable, but if you're dependent on this drug and withdrawing, you'll know what I mean when I say "take the edge off". You can do this as long as you want - so long as you stick to that dose, and keep decreasing. It's better to do it "too slowly" than "too fast". If you're withdrawing from a benzo with a short half life (e.g. temazepam) I'd strongly suggest seeking professional help before you attempt it alone.

As Mouse said, you're better to do this under medical supervision. This way, it's quite easy to work out a tapering programme.

Alcohol, benzos and barbs are not to be messed with. If anyone reading this finds that they are "hooked" on any of these substances, please consult your GP and let them know about your wish to withdraw. For anyone reluctant to consult a GP or other health care professional, remember it is better to withdraw too slowly than too quickly.