If withdrawal (especially "voluntary") is unsuccessful, then it's better to view that as a temporary failure (not permanent), and try again: resume the effort, and avoid repeating the same mistake. With practice, more experience, you become more skilled at withdrawing (and eventually succeed).
I think experience matches conventional advice, and matches what can be inferred from the suttas.
Successful withdrawal tends to happen for one or more reasons (possibly several reasons):
- You "consider the disadvantages" of addiction (or the advantages of non-addiction) -- and so decide that you prefer withdrawal or abstinence. This "preference" (even if it's only a moral or intellectual preference) might be a sufficient substitute for "pleasure" -- it's a new form of "I want" (e.g. "I want freedom and harmlessness") which replaces the old "I want" ("I want the so-called pleasure associated with the addictive behaviour, which I now see the several disadvantages of").
- We're social and maybe highly-motivated to conform to social behaviour. So spending time (possibly all your time) with people who don't exhibit that behaviour can help you quit -- they're good role-models, they're not bad role-models, if you successfully imitate their (not "addictive") behaviour then you too will be behaving that way -- and maybe we're really good at imitating who we're with, we've been learning how to imitate people since we were infants.
- There are reasons for the behaviour, and/or conditions in which the behaviour occurs. If the reason disappears, and/or if the conditions change (e.g. you move to a different place or visit different people), then the old conditions no longer exist (and so the behaviour can be different too)
- Substitute or replace the behaviour: maybe you can't just stop, and instead you need to do something else -- that something else (new behaviour) might be meditation or it might be sweeping the yard. Non-stressful activities might be best, at least initially (partly because you may be distracted by cravings); maybe some "mindful" activity though (to learn the new situation and behaviour), not an "escapist" activity.
- Anything you do is learned behaviour, a skill which takes practice, maybe you weren't good at it to start with. If you practice (make the effort) it gets better, easier, more skilful -- maybe the hardest part is the beginning (e.g. the first day, the first few days), and the longer you do it the easier it gets.
- You might find that being generous is rewarding (as a substitute behaviour), so consider that -- that might take your mind off your own (temporary) cravings and thus make "withdrawal" easier. Maybe beware though that addictive behaviour might be addictive because it's rewarding or because you're reward-seeking (e.g. pleasure-seeking); so maybe that (generosity) is behaviour to attempt when you're a little more stable (and maybe can enjoy it for its own sake and not just for immediate reward).
- Cravings come and go. The craving is just a thought, "Suppose I were to now repeat that action to which I'm addicted?" It's distracting and you might need to stop (activity) and do nothing (temporarily), except breathing of course and e.g. standing still, until the craving goes away. Perhaps that's what you mean by "mental difficulties" in the OP. I think craving does go away (and come back again, and go away again).
- If you don't reinforce the craving by repeating the habit then the craving returns less and less often and with less intensity. Eventually it doesn't even bother you, you stop thinking about it, and if you do ever think about it then you're glad it doesn't even bother you anymore
- The addictive behaviour might be part of a thicket of views, e.g. "if I don't do this then I'll get angry, and I can't (afford to) get angry so I must do this (behaviour instead)." That's a typical "false dichotomy".
- You might think, "I'm doing well, I can just do it (that addictive behaviour) once now." But maybe if you persuade yourself it's OK to do once, then by the same logic it's OK to do once more after that, and so on -- so once might lead to twice, and falling back -- if you do try that and that leads to failure then try again, and maybe decide that "never" is safer and more sustainable.
As for "lack of pleasure" I'd hope that you'll begin to benefit -- e.g. from freedom and non-intoxication -- to whatever extent you become unaddicted. You might want to re-evaluate what's pleasurable, what pleasure is -- or to re-evaluate your preferences (e.g. to prefer what "praised by the wise", "skilful", "blameless", and so on e.g. as detailed in the Kalama sutta or other suttas).
Maybe this too (which has parallels in the vinaya, as well as being conventional addiction-recovery advice):
- Define a rule (about the behaviour) for yourself to follow, a rule which limits or restricts the behaviour to when it's necessary and harmless, or a rule which cuts out the behaviour completely. Make following that rule a priority, the top priority, your only priority at least initially (until it becomes a second nature).
- Maybe choose a specific date on which to start to follow the rule: "Yesterday I didn't follow that rule, but today I will follow that rule, today I am, today I did."
- Keep track of the success: an hour, two hours ... a whole day ... another morning ... a week, two months, the first whole year, etc.
- Maybe confess to someone else (not only to yourself), a friend or teacher or support-group, someone who knows what you're trying to do and wants to help: confess if or when you break the rule (maybe promise the confess and then even if you break the rule take care not to lie about it as well), and discuss the problem. Maybe it's easy to confess (when there is any behaviour to confess) if you schedule a regular meeting for the purpose of confession, and to talk about problems and successes.
This last section -- e.g. rules and confession -- can be quite effective.
It's so effective that there is a view (i.e. many people say) that it may be the only way to succeed -- and that whether you succeed depends on whether you're willing to agree to participate in this method: to accept that the behaviour is a problem, to commit to following the rules and to confessing, to attend (and continue to attend) the meetings.
Seclusion can help too. Maybe the addictive behaviour requires something (a addictive substance like alcohol, an addictive thing like access to the internet, and/or another person). If that something is within easy reach -- and especially if you wilfully keep that thing within easy reach -- then "back-sliding" is easier.
So part of success might be to deliberately (in whatever moments of sanity you may have) do something to make your access to that thing more difficult: e.g. remove the substance or the thing from your home (or e.g. leave home to go on a retreat). Then when the craving happens it would require a longer and more deliberate effort to re-acquire that thing.
Addictive behaviour might be something you can do easily and without thinking about it much, it might be successful to replace that with a situation which requires some intentional effort, for example, "Craving: suppose I were to have that thing as usual?", answered by, "No the situation is different now, I'm following a different rule. And the thing isn't here, it isn't available to me. I could make the effort to get up and walk out and go and get it -- but I don't want to do that and I don't have to, I will not do that, I am not going to do that, that would be a wrong effort, instead I'll simply do nothing and stay relaxed until another, different (wholesome, acceptable) thought occurs to me instead of this (temporary) craving."
That may change the equation, the balance:
- Instead of being a behaviour that happens automatically, without thinking (or even instead of thinking), almost by accident (except that it happens again and again and again), and which only takes a (thoughtless) moment, it becomes a behaviour which you'd have to think about, to do deliberately, something which requires some sustained effort (over several minutes at a minimum), something that you'd have to be conscious of doing (and which you can therefore decide not to do, not to "enable")
- Your new situation makes it easier to follow the rule than to continue the addictive behaviour. The situation is seclusion or isolation from whatever "thing" the behaviour involves -- also seclusion from any other "trigger" that might be associated (e.g. if addiction to X is to escape from Y which makes you angry, then the seclusion from X is also a way to escape from Y).
There are maybe specifically-Buddhist techniques as well -- e.g. non-identification, guarding the senses, mindfulness (remembering), calm (peacefulness), even virtues -- and maybe you know something about those already. But I think all the above (including friendship and mentoring) are Buddhist and also overlap with non-Buddhist addiction-recovery advice and methods.