Welcome! Yes it is a lousy habit. Our addictions become habits because they get connected to reward centres in our brain. It’s that dopamine rush. We all do / did it.
Recovery is about changing habits. It is a process and it takes support and help. You did a brave thing and an important thing reaching out for help. There’s lots of wisdom here.
This is one of my fave threads for learning:
You’re a good person and you deserve a safe, sober life where you can be your full self.