I have a Garmin eTrex that’s gathering dust in storage somewhere. I use my iPhone with GaiaGPS for all my hikes now.
The key is to download the map layers you want before you head to the trail. Once you’ve got those, put your phone in airplane mode to conserve battery. GPS will still function, and with the maps downloaded, you’ll be able to navigate even without cell service.
Note that an iPhone or other smartphone will not be as accurate as a dedicated GPS device, but in my experience it’s worked well for trail navigation.