Yes it is your own codependency that is responsible for your misery. It isn't your husband. You need to get help for YOURSELF.
Stop asking "what can I do to change my husband" and start asking "what can I do to change ME". Because you are the only one you can change.
It took me a very long time to learn this lesson. I blamed my husband for all my misery for years. But it wasn't until I took a good, long, hard look at ME that things started to change.
It's just the only way. I wish I could give you a magic formula to make everything ok but there isn't one.