Can't connect pi4 with my pc and my pc as broker

Hello everyone im new to node-red . Im trying to connect a plc s7-1200 with pi4 using mqtt ( mosquitto) and setting up my pc as a broker so the problem is my pi4 can't connect with my pc when activating node red in terminal (1883 port) and when i tried to ping the pi4 it's unsuccessful. i followed a youtube tutorial here is the link : communication between Raspberry PI and PLC S7 1200 using MQTT - YouTube
ps:in the video he opened node red in his pc and i couldn't do that only in pi4
please if you have any ideas let me know ill be appreciated

It seems odd to install Mosquitto on a PC if you have a Raspberry Pi4 with Node-red on it.

It's simple and very reliable to install Mosquitto on a Pi and you can guarantee that MQTT messages will continue to flow even if the PC is turned off.
The MQTT broker should have a static IP and Mosquitto has to be configured to allow connections from other devices.

If you can't ping the Pi, can you see it on the network? IpScan24 on the PC is a good tool for this.
What does the ifconfig command on the Pi show?