If I connect my laptop to a Wi-Fi hotspot provided by the phone? Is there a way to let me SSH into the laptop via an IP address?

Or vice versa, allow the laptop to SSH into the phone (I can already SSH into my phone on my local network by using an app that provides an SSH server on my phone) from the laptop while it’s connected to the hotspot.