Open the Settings app on your iPhone
Tap your name at the top
Tap Find My
Tap Find My iPhone
Turn off Find My iPhone
Enter your Apple ID password if prompted
Turn off Find My network if shown
Turn off Location Services if you want to fully disable location tracking:
Settings > Privacy & Security > Location Services
Turn off Location Services
If you want to remove the device from your Apple ID:
Go to iCloud.com (or use the Find Devices section in the Find My app)
Sign in with your Apple ID
Select the device
Choose Remove from Account (or similar option)
