There are several ways to back up your data.
Method 1:
Go to "Settings" -> "System" -> "Backup"-> Activate "Back up your device" in the window which has now opened -> Select the options you want to back up. You need to add your Google account details first.
Method 2:
You can back up your data to another device via the “Switch Phone” app, and then recover data when your device has been repaired.
Swipe up in the home screen to find the search bar->enter “Switch Phone” ->Transfer the contents by following the instructions.
Note: Available settings and menus may vary depending on device model and software version.