There are a few details missing from your question that make it hard to provide a single answer, so here are a few options.
Dynamic DNS (DDNS)
If you control the router on your network and can arrange to map an externally
visible port to your target machine, then you may be looking for a dynamic dns
service. You run a client on your
local machine (or home router), and it regularly updates DNS information in a
remote service so that yourname.some.domain
always resolves to your current
IP address.
You can implement this yourself using AWS Route53 (or any other DNS provider with a reasonable API), or you have your choice of multiple dynamic DNS services.
Search for "dynamic dns service", look at the available options, find some reviews, and pick something that works for you.
External proxy service
There are some proxy services -- ngrok is a prime example -- that will let you expose internal services at a public address. There are a number of alternatives.
VPN
Another alternative is to set up a personal VPN using a service like Tailscale. This will allow you to create a secure, virtual network so that devices with appropriate credentials can be configured to act as if they were on the same network as your target server, making it easy for you to ssh into your server from anywhere.
You can implement something like this yourself using open source VPN solutions like Wireguard or OpenVPN, but this does require that you can run a "public" VPN endpoint somewhere.