It makes sense to reuse, recycle, give away or sell on fully functional phones and computers when you’ve upgraded to the next model. Unfortunately, unethical chancers can, have and will data-mine ...
You can then play a sound to ping the device, lock it, and display a message on the screen. If necessary, you can opt to wipe all your personal data so that a hacker can’t steal or compromise it.