When someone says “I can’t help it,” or "I can't help doing it,” it’s a way of saying that they don't want to do a particular thing because they know it's not good, but they can't stop themselves from doing it.
People use this expression when they are having trouble breaking a habit, like biting their fingernails or eating too much sugar. They also use it when something is external and beyond their control.
I can’t help it + if is can be a way of declaring that something is not your fault, as in:
I hope this helps.