What is the correct way to wire a piezzo buzzer with a potentiometer and a button?
You are using the Arduino basically as a power supply (in your wiring). The linked wiring is for PWM (analogWrite). This allows pulse output to generate tone (and volume). Here is a good reference.