Well done @pleasedontjudgemeidontneedit
You shouldn't feel terrible about yourself. You probably got addicted in the first place because you are so harsh and critical of yourself and it helped you cover up all those bad feelings and pain.
You are a lovable and good person.
You can get over this but you do need help. Anyone would need help to get over this.
You've tried to manage it all alone - and that hasn't worked.
That is also such a burden to carry alone and makes you feel so ashamed about people finding out.
Well, now people have found out, and hey, its not so bad. And now someone can help you.
Start talking to someone and you won't feel ashamed any more. You'll realise that people are compassionate and kind.
Lots of people get addicted to codeine, alcohol and all sorts of other substances. It is common and even some of the most "competent" and "together" looking people can be hiding addictions (sometimes even from themselves).
You need help first of all to taper off and get over the addiction. That will take some time. Even when the physical dependence has gone, there is still the psychological dependence of feeling you can take a pill to make you feel alright. It is very difficult when that route is taken away. It can take 6 months or a year to really get through it.
At some point there is the question of the emotions that you were trying to escape from by taking these tablets to feel alright. It could be helpful to have someone to talk to about what is underneath this addiction and this depression. The addiction is your way of trying to manage feelings that you are worried are unbearable. But you might come to know that if you can know about them and talk about them to someone else, they become more bearable.
And while you think you must take the codeine or you will feel terrible physically (which you will, due to the withdrawal) once you are through that, you will realise how much better you feel NOT on it, lighter, more alert, clear headed and none of that shame and worry about where the next pills are coming from and just how many you are getting through each day. Just imagine, a life with none of that.
It is worth the short term discomfort of withdrawal, definitely.