Gmail Notifications on my Galaxy Note10
Navigate to Settings > Device Care > Battery > App power management > Apps that won't be put to sleep.  Add Gmail to this list to prevent it from being put to sleep for battery optimization. You could also disable this feature entirely by disabling "Put unused apps to sleep."