Please help with firewall settings on Ubuntu

I’m needing some help on this - I don’t know what i’m doing in the terminal to execute the correct rules ? Is there a start to finish template to get it working ? I tried copying the above but it says directory does not exist

sorry in advance I was forced over to linux by windows 11 upgrades