You use a PC, laptop or even a Raspberry Pi 4 to write code and push your program to a Raspberry Pi Pico - which then runs that code whenever it's powered up.
The Raspberry Pi Pico Start Page shows you how to do this with MicroPython or C/C++, and contains lots of other helpful information to get started with programming the Raspberry Pi Pico.