It depends. Mortal sin is when you do something with full conscience and freedom, and when what you do is a grievous offense to the holiness of God. So this is a grave sin, like using curses or similar expressions. In such cases, you cannot participate in the community without repentance.
This is a grievous sin. However, when people use the name of God without much thought, this is not a grave sin. Of course, you must strive to abandon this habit, but you can repent and confess on another occasion.
I do not consider this a grave sin when you do it without awareness.