retroshark gemmomoh Yo yo! As @LoipesMas mentioned, you are trying to reference a signal without attaching it. I would suggest reading up on signals in Godot. Once attached to the script you will be able to have the line print("pressed") and it will work as intended. Edit: Marking @LoipesMas reply as the best answer.
LoipesMas In the docs for BaseButton you can see that pressed is a signal. What you want is probably button_pressed property. However, I generally recommend using signals and callbacks instead. Those are explained here