Listen for HTTP(s) or mqtt external events

Hi,

I am trying to figure out how I can listen for external http(s) or mqtt events.

I have a vehicle tracker which can push events via HTTP(s) or mqtt but I’m unsure how to capture these incoming events in HA.

I assume I’d need to open up a port on the firewall for direct access to the HA server, or can this be done via Nabu Casa?

If anyone could provide a detailed explanation and example of how to configure this I be grateful as still new to HA and learning.

Thanks