Potentiometers are variable resistors. Potentiometers have a knob that varies the output voltage (by varying the resistance as they are turned). The analog pins on the Arduino can measure this change.
void setup() {
Serial.begin(9600);
}
void loop() {
int val = analogRead(A0);
Serial.println(val);
delay(100);
}