Running a webserver on one Pico W and doing a simple request on the other should do the trick.
Can easily be done in MicroPython.
Shameless plug
https://www.amazon.com/Raspberry-Pico-Simplified-Luc-Volders/dp/1471032361/ref=sr\_1\_3?crid=2FJD46R2SXCJR&keywords=luc+volders&qid=1670154926&s=books&sprefix=luc+volders%2Cstripbooks-intl-ship%2C201&sr=1-3