Hello, I am not new to electronics, but am not a professional, but rather an amateur. I have recently made a simple circuit made to control a normal wall outlet, using the Arduino (More specifically a custom board with the ATMEGA328) and a relay (No real use for it, just to see if I could achieve it), and as expected it worked flawlessly. However due to one main disadvantage of the relay (Speed) I am not able to do much with it (For example blink per 100ms safely or do any PMW), as well the problem of it being mechanical. So I've basically connecting the relay to an output which can have a lamp plugged in or something ect.
Now I want a way to communicate with at the most 230-250V with the Arduino, in a high speed, and safe manor. I want to be able to take use of the PWM function like fade, which I am pretty sure a transistor can do? However my problem is, I don't know which transistor to use, I don't know how to make it safe and although I understand how a Transistor works, I am unaware on the "Amplifying" affect it can have. Can some provide with a schematic of what I am trying to achieve which is basically what I already have but with a transistor or maybe something else (SSR?) to take advantage or PWM on high voltage appliances.