If the previous owner is with you and can access the device
Ask them to erase all content and settings by choosing Settings > General > Reset > Erase All Content and Settings. They'll need to provide their Apple ID and password. After the device is erased, you'll can proceed with the device setup process.
If the previous owner is not present
Make sure the device is powered on and connected to a Wi-Fi or cellular network. Then contact the previous owner and ask them to follow these steps to remove the device from their account: