Cannot connect to MQTT Broker

Hello,
I’ve been working on the Node-RED via MQTT example provided by Simumatik. However, I’m facing an issue with connecting to the broker, with an error saying “Connection with 127.0.0.1:1883 cannot be established”. I tried using different ports, but the issue persists. I used MQTTBox to communicate with the Node-RED dashboard, and it seemed to work properly.
Any help would be greatly appreciated.
Thanks