There is one way to get this wrong and it is expensive: factory resetting the phone while it is still signed into your Google or Samsung account. Do that and Factory Reset Protection stays armed, the phone demands credentials nobody has on the next setup, and it becomes worth almost nothing to any buyer including us.
It takes about ten minutes to do properly. This is the order, and the reasoning for each step, because the reasoning is what stops people improvising.
Step 1: Back up, and check the backup exists
Samsung Cloud, Google One, or a cable to a computer. Whichever you use, open it afterwards and confirm the photos are actually in there. The number of people who discover an incomplete backup after the reset is not small, and the reset is final in a way people only appreciate afterwards.
One thing that no backup covers: Secure Folder. Anything inside it is destroyed by a factory reset and cannot be recovered from a normal backup. If you have used Secure Folder, move what matters out of it first.
Step 2: Remove your Samsung account
Settings, then Accounts and backup, then Manage accounts. Select your Samsung account and remove it. If Find My Mobile is on, turn it off first under Settings, Security and privacy, Find My Mobile.
This is the step people skip, because Google gets all the attention and the Samsung account is easy to forget is there.
Step 3: Remove your Google account
Same place: Settings, Accounts and backup, Manage accounts. Remove every Google account listed, not just the main one. A secondary work account left behind will arm Factory Reset Protection exactly as effectively as the primary one.
If you have a work profile or the phone was ever enrolled in a company's device management, that has to be released by the employer's IT team. Nothing you can do on the handset will clear it.
Step 4: Now factory reset
Settings, General management, Reset, Factory data reset. The phone will list what is about to be erased and ask you to confirm, which is your last chance to notice a backup you did not actually make.
Take the SIM and any microSD card out before you pack it. Neither is worth anything to us and both are worth something to you.
Step 5: Verify it actually worked
This is the step almost nobody does and it is the only way to be certain. Power the phone back on and go as far as the first setup screen.
If it asks you to connect to WiFi and then requests a Google account that was previously on the device, Factory Reset Protection is still armed and the reset did not achieve what you needed. Go back, sign in, remove the accounts properly, and reset again.
If it shows a plain welcome screen and lets you proceed as a new device, it is clean and ready to send.
What if the phone will not switch on?
Then none of the above is possible, and that is fine. A phone that genuinely will not boot cannot be checked for a lock by anybody, so we buy it as a dead phone and handle the data destruction ourselves.
Every device that comes through here is wiped before it goes anywhere, whether the seller managed to do it or not. The reason we ask you to do it yourself is that it is the only way to release Factory Reset Protection, not because we would otherwise leave your photos on it.
The short version
Back up and check the backup, remove your Samsung account, remove every Google account, then factory reset, then power it on and confirm it reaches a plain welcome screen. Doing the reset before removing the accounts is the mistake that makes a phone unsellable, and it is the only genuinely unrecoverable one on this list.