Sure, you’d need a domain name, a certificate, an IP address that’s reachable from the outside, and the RasPi or some other computer.
If it’s some residential internet connection, you might be able to open up a port and forward that to your RasPi. You’d need to do that in the internet router. Port 80 and 443 are for HTTP(S). (protocol: TCP). Some internet providers don’t allow any of that.
Your IP address will change with most regular internet providers, so you’d want to buy your domain name somewhere you can change it automatically with a script. Or use DynDNS. duckdns.org would be one of those DynDNS providers.
If your internet service provider doesn’t allow incoming connections and port forwards, you need to work around that. Use Cloudflare, or better, some better tunnel provider.
Free certificates for HTTPS are available from letsencrypt.
And if it turns out Lemmy is too heavy on the Raspberry Pi, try PieFed instead.
Nice. Hope it does the port forward as well, because in my experience that’s the part where you could face some issues. DynDNS is relatively easy, in case your router hadn’t supported this, it’d be possible to let the Pi handle that.