user11030: Lets suppose I have a circuit with a car battery, a switch and a led. The led will turn on when the switch is closed, and turn off if it's not. I want to remove the led from the circuit and put an Arduino in that place to "read" when the circuit is closed or open.
I'm a good programmer, so the code is not the real problem. I only want to know how to do this without damaging the board.
How can I do this?

user2944: As @Gerben says, voltage dividers are a good place to start. To elaborate on the topic, you can use a combination of voltage dividers, zener diodes and clamping diodes. 
This EE.SE post has some good info about this, related to ADC, but still the same.
First off, a voltage divider circuit is easily found on the internet,

Google
Wikipedia

This circuit from Hyperphysics shows the basics:
 

To add more protection to this so as not to go over the max I/O voltage of the MCU, you can add a zener diode on the Vout. 
That would give you something like this(Olins): 

This will give you the desired range to give legitimate High and Low on an I/O.

If you wanted to forgo the voltage divider and zener you can use clamping diodes to the microcontroller supply voltage Vcc. This will give a range that will not damage the I/O.

simulate this circuit – Schematic created using CircuitLab
The 10k resistor is there to limit the current through the diodes, which are Schottky diodes.

Another method, which I have used before and is reliable, is to use a diode and two resistors like below:

The logic is that, when the input IN is > Vcc(5V) the signal on the I/O _IN will be the voltage of the pull_up resistor R2, if it is low or floating the signal will be low. R1 also gives a known logic state if the input floats.
Edit: Changed the image to proper logic flow.

11030: <p>Lets suppose I have a circuit with a car battery, a switch and a led. The led will turn on when the switch is closed, and turn off if it's not. I want to remove the led from the circuit and put an Arduino in that place to "read" when the circuit is closed or open.</p>

<p>I'm a good programmer, so the code is not the real problem. I only want to know how to do this without damaging the board.</p>

<p>How can I do this?</p>
 2944: <p>As @Gerben says, voltage dividers are a good place to start. To elaborate on the topic, you can use a combination of voltage dividers, zener diodes and clamping diodes. </p>

<p>This <a href="https://electronics.stackexchange.com/questions/35807/how-would-i-design-a-protection-clipper-circuit-for-adc-input">EE.SE post</a> has some good info about this, related to ADC, but still the same.</p>

<p>First off, a voltage divider circuit is easily found on the internet,</p>

<ol>
<li><a href="https://www.google.com/search?q=voltage+divider&amp;ie=utf-8&amp;oe=utf-8" rel="nofollow noreferrer">Google</a></li>
<li><a href="https://en.wikipedia.org/wiki/Voltage_divider" rel="nofollow noreferrer">Wikipedia</a></li>
</ol>

<p>This circuit from <a href="http://hyperphysics.phy-astr.gsu.edu/hbase/electric/voldiv.html" rel="nofollow noreferrer">Hyperphysics</a> shows the basics:
<a href="https://i.stack.imgur.com/cLmul.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cLmul.gif" alt="Hyperphysics"></a> </p>

<hr>

<p>To add more protection to this so as not to go over the max I/O voltage of the MCU, you can add a zener diode on the <strong>V<sub>out</sub></strong>. 
That would give you something like this(<a href="https://electronics.stackexchange.com/a/48317/46355">Olins</a>): </p>

<p><a href="https://i.stack.imgur.com/CSQ5O.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CSQ5O.gif" alt="credit to Olin"></a></p>

<p>This will give you the desired range to give legitimate High and Low on an I/O.</p>

<hr>

<p>If you wanted to forgo the voltage divider and zener you can use <a href="https://en.wikipedia.org/wiki/Clamper_%28electronics%29" rel="nofollow noreferrer">clamping diodes</a> to the microcontroller supply voltage Vcc. This will give a range that will not damage the I/O.</p>



<p><img src="https://i.stack.imgur.com/HrneK.png" alt="schematic"></p>



<p><sup><a href="/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fHrneK.png">simulate this circuit</a> &ndash; Schematic created using <a href="https://www.circuitlab.com/" rel="nofollow">CircuitLab</a></sup></p>

<p>The 10k resistor is there to limit the current through the diodes, which are Schottky diodes.</p>

<hr>

<p>Another method, which I have used before and is reliable, is to use a diode and two resistors like below:</p>

<p><img src="https://i.stack.imgur.com/uDj4f.png" alt="enter image description here"></p>

<p>The logic is that, when the input <code>IN</code> is > Vcc(5V) the signal on the I/O <code>_IN</code> will be the voltage of the pull_up resistor <code>R2</code>, if it is low or floating the signal will be low. R1 also gives a known logic state if the input floats.</p>

<p><em>Edit</em>: Changed the image to proper logic flow.</p>
