Stop someone tracking your location right now
Once you've confirmed unwanted tracking, the goal is to cut every channel: explicit sharing, app permissions, and account access.
iPhone: Settings → [your name] → Find My → Share My Location → toggle off, then remove individual people. Android: Google Maps → profile picture → Location sharing → tap each person → Stop.
Set anything non-essential to 'Never' or 'Ask Next Time'. Maps, ride-share, and weather apps only need access 'While Using'. Delete any app you don't recognise.
If someone has your Apple ID or Google account password, they see your location regardless of what you toggle on the phone. Change the password and turn on two-factor authentication. Sign out all other devices.
Turn off Wi-Fi and Bluetooth scanning when not in use (Settings → Privacy → Location Services → System Services on iPhone; Settings → Location → Wi-Fi & Bluetooth scanning on Android). These let you be tracked even with location 'off'.