Generally, the thumb of your dominant hand is used to press the spacebar while typing.
While it's recommended to use both thumbs for efficiency, most people naturally favor one. Right-handed individuals tend to use their right thumb, and left-handed individuals tend to use their left thumb. The best approach is to use whichever thumb feels most comfortable and allows you to maintain a consistent typing rhythm.