Ronasara. Many thanks for your reply to my question.
My problem is as you first deduced .. My Mac is connected to wifi. However, Safari cannot connect to a search engine.
I have restarted the modem. All of my devices, apart from the Mac, which use the home network work ok. AirPrint is fine from the iPad. Our boiler for hot water and central heating uses the Hive app This works fine.
The problem of no access to a search engine started after I inadvertently pressed to yes button on a dialogue requesting access so the app behind it could monitor files etc from the internet for security.
I have just reinstalled MontereyOS. It took 11 hours to complete. Wifi was needed to allow the process to go ahead. However, the problem of being blocked from using a search engine wasn’t removed by this process. So it looks like I can get internet access with Apple, yet am blocked from using a search engine such as Google Chrome. It’s very frustrating!