To use the Mosquitto as a broker, go to the integration page and install the configuration with one click:
Navigate in your Home Assistant frontend to Settings -> Devices & Services -> Integrations. MQTT should appear as a discovered integration at the top of the page