Stopping injecting can take as much effort and willpower as detoxing. You can do both together and deal with everything at once. Although this is hard, you know where you stand and with no ‘half measures’ it can feel like the only way to do it.
For some, step by step is better: switching to smoking heroin for a while before the detox can break the process into manageable parts. Another alternative is to switch to methadone mixture for the detox. This can give you a chance to get used to coping without the rush and the ritual of injecting, before you have to cope with being drug-free. Neither option is easy and sometimes it takes time and/or several attempts to stop injecting.