Turning on and off LED according to the toggle switch state

look like i need to a resistor between the pin and ground and it works thanks for your reply