Scheme to easily connect arduino to 220v

To build this project you need a 2n2222 transistor, a 1n4007, a relay srd-05vdc-sl-c, a 1k resistor and lots of wires.

For the code you should just use the thing you connected to the arduino as a LED.