Example code of the Raspberry Pi Pico W connected to a Servo.
The servo and the Pico W need to be connected to a common Ground wire (always).
In general I power my servos using their own power supply. This takes the load off the microcontroller and its voltage regulator.
Care must be taken with the logic yellow wires. My servos they appear to be 3.3v and not 5.0
Please click thumbnail image to start the video