You likely share your location via your iPhone’s Find My app with friends and family. It’s a convenient and straightforward way to let them know where you are at any given time of the day.
And while location sharing is obviously meant as a safety feature to give your friends and family peace of mind, as well as them being able to locate you if the situation arises. It’s not ideal if you’re trying to plan a surprise or secretly go holiday shopping.
You can stop sharing your location with somebody and they won’t be notified when you do. However, it’s easily discoverable as you won’t appear as a friend anymore in the Find My app. Also, they will be notified when you start sharing your location with them again.

If you want to temporarily stop sharing your location without actually unfollowing somebody, you can do a few things, however. You can turn your iPhone on airplane mode or turn it off completely.
As discovered by MacRumors, there’s something else you can do — sort of a hack — if you have another iPhone or iPad.