So, the first thing you might want to look for is the root cause of where this all started. Try to sit in a quiet place or in whatever context you think best in and mull it over. When did you start trying to get away and why? Was it one particular event, or did it just slowly creep up on you until you noticed it happening?
Once you figure out why you did it, you need to have a discussion with your husband about it. A relationship is supposed to be malleable, because people’s needs change, the relationship needs to be able to keep up. There’s something he’s doing that’s triggering your behavior. Discussion is intended to work around the problem by not triggering it. Behavior is way easier to change than psychology.
Finally you’re going to want to work on healing. That trigger didn’t come out of nowhere, these things stem from insecurities built up over years. Regular sessions of talk therapy are excellent at bringing these to the surface so you can work on them.
Good luck!