Here is an example of how to write to a 74HC595 in both C and Micro Python. To build the C project follow the instrutions here Getting Started with Raspberry Pi Pico. The Micro Pyhton version should just be a drag and drop in Thonny. The C version counts and the Micro Python version displays the current temperature reading of the onboard temperature sensor.
Below is a picture of how the breadboard was wired up, I am a complete novice at electronics so there is most likely a mistake so please check with a datasheet first to confirm what pin goes where.