I made something similar a few years back with a Pi 1 and a GSM "hat".
It came with a C SDK so I had to write AT commands to communicate directly with the modem and it worked great until I didn't need it anymore.
Its purpose was to text me when my power or internet connection went down at home then I could respond with commands such as to shutdown the servers etc.
When power/network came back it would text me the new address so I wouldnt need an outside service for DDNS.
The biggest challenge with the whole setup was finding a SIM from a provider who would let me top it up once per year and maybe send half a dozen texts in that time without deactivating the SIM, for a reasonable price.
A good free way to achieve this is to use Signal. This project https://github.com/AsamK/signal-cli enables you to send Signal messages from the command line, including from Raspberry Pis. It obviously needs an internet connection to work, but has the added bonus of being more secure than SMS.