I used below steps to build the circuit:
1. Connect one end of the tilt sensor to the +5V. Connect the other end to Arduino digital pin#5
2. Connect a 10K resistor in series with the digital pin#5. Connect the other end of the resistor to the GND.
3. Connect the negative leg (short) of the LED to the GND. Connect the positive leg (long) to Arduino digital pin#3
4. Connect a 330 ohm resistor in series with the digital pin#3. Connect the other end of the resistor to the GND.
You can use the sketch to test the tilt sensor. If everything goes fine, you should see the LED glow when the sensor is tilted. You can also check the print message in the Arduino serial monitor.