To avoid any kind of data loss and breach, it is a standard way to reset your phone before sending it for repairs.
But now Google is working on a standard repair mode for all devices operating on the Android system.
The Android Repair Mode was added to Google Pixels only, now Google is working hard to add this as a built-in solution to Android for all smartphone makers.
This method will allow you to enable the repair mode and disable it whenever you want. When the repair mode is enabled, your phone will look like a fresh install and no data will be visible to anyone.
Your personal and actual data will remain the same but will be hidden from unauthorised entities. Similarly, this option will not be disabled by any third person.
This feature has already been added to Android 14 Beta for Google Pixel phones.