Use the steps in this support article to prepare it for use by the other person. --> What to do before you sell, give away, or trade in your iPhone or iPad - Apple Support
To that specific message, Apple has two related features, Activation Lock ( Activation Lock for iPhone and iPad - Apple Support ) and Find My ( iCloud+ - Find My - Apple ), which are designed to prevent anyone else from using an iPhone, iPad, or iPod touch if it's ever lost or stolen. Deactivation of either requires knowing the Apple ID and password that set the feature, or by placing a special request to Apple to reset the device. This Apple ID information essentially defines the current ownership of the device.