resistor

Short circuits on Arduino pins, or attempting to run high current devices from them, can damage or destroy the output transistors in the pin, or damage the entire Atmega chip. Often this will result in a "dead" pin in the microcontroller but the remaining chip will still function adequately. For this reason it is a good idea to connect OUTPUT pins to other devices with 470? or 1k resistors, unless maximum current draw from the pins is required for a particular application. . what does the above means . i thought resistor reduces the current. i want to connect a 5 volt relay. can i do it directly

A 5V relay should not be connected directly. The current drawn from a pin should be limited to 20mA. Check the datasheet for the relay, it almost certainly needs more current than that. Use a transistor driver with a flyback diode across the relay coil.

sanjaytank: Short circuits on Arduino pins, or attempting to run high current devices from them, can damage or destroy the output transistors in the pin, or damage the entire Atmega chip. Often this will result in a "dead" pin in the microcontroller but the remaining chip will still function adequately. For this reason it is a good idea to connect OUTPUT pins to other devices with 470? or 1k resistors, unless maximum current draw from the pins is required for a particular application. . what does the above means . i thought resistor reduces the current. i want to connect a 5 volt relay. can i do it directly

Hell no. As the other poster says, relays typically draw far too much current, and generate destructive flyback current back when they are disconnected. See his comment about using a driver transistor and a flyback preventer diode on your relay.

It would look something like this.

sanjaytank: what does the above means . i thought resistor reduces the current.

The application of a resistor as described would probably not affect anything if the microcontroller were being connected to another high-impedance device, e.g. CMOS. Because the impedance is very high, so little current flows that the resistor would not cause a significant voltage drop, but would protect the microcontroller by limiting current in the event of a short or other wiring error.