You can get apps which do that. check your relevant App Store.
I have no affiliation whatsoever with O2 or any subsidiary companies. Comments posted are entirely of my own opinion. This is not Customer Service so we are unable to help with account specific issues.
Currently using: Pixel 7a (O2 & Lyca), One Plus 6 (Sfr), iPhone 12 Pro Max (Vodafone)
If you have registered the device with either Apple and find my iphone, Samsungs variant or Google, and you know the app store password you can use these tools to remotely lock and track the device
- Xperia 1V - o2 and Spusu - Pixel 8 Pro - o2 and Vodafone UK