Raspberry Pi Pico W documented WiFi setup
This program attempts to provide an example with notes and documentation of key and common procedures for the Raspberry Pico W using MicroPython with the class WLAN – control built-in WiFi interfaces:
https://docs.micropython.org/en/latest/library/network.WLAN.html
Please note that this is using the latest at the time of this writing for the Pico W with Bluetooth support (RPI_PICO_W-20240222-v1.22.2.uf2) from here:
or the latest released build v1.22.2 (2024-02-22) from here:
https://micropython.org/download/rp2-pico-w/
Of special note are the Wifi power management features and other RP2 specific items in the code comments.