Yes, you can factory reset your Samsung phone while still connected to your Google account. This will allow you to restore your device to its original settings and retain access to your Google Account data, such as contacts, calendar, and emails. To do this:
1. Go to your phone's Settings app.
2. Select 'Account' or 'Google' (depending on your Samsung model).
3. Tap on 'Add account' or 'Sync accounts'.
4. Choose Google account sync option and log in with your Google credentials.
5. Once connected, go back to the Settings menu and select 'General management'.
6. Scroll down and tap on 'Reset'.
7. Select 'Factory data reset' and confirm the action.
The device will then perform a factory reset, wiping all data, apps, and settings. After the reset is complete, you'll need to sign in with your Google account to restore your data.
Note that if you have other accounts synced on your phone (e.g., Apple ID, Facebook), make sure to select those as well to avoid losing access to your contacts, photos, or other data.