In the Find My app, you can turn on separation alerts for a device so you don’t accidentally leave it behind. You can also set Trusted Locations, which are locations where you can leave your device without receiving an alert.
If you have an iPhone Wallet with MagSafe and Find My support, you can get an alert if it detaches from your iPhone.
Important: In order to receive separation alerts, make sure you allow notifications for the Find My app. See Set separation alerts in case you leave an AirTag or item behind in Find My on iPhone