A triac is like an SCR, but conducts on both positive and negative AC half-cycles.
So, what's an SCR, I hear you ask... An SCR is a 3 terminal device. The terminals are called Anode, Cathode and Gate. The basic idea is that SCR will conduct current from the Anode to the Cathode, BUT only after a trigger signal is applied to the gate. It will keep conducting after you remove the gate signal, so the only way to turn it off is to 1) remove the source of current, or 2) short out the anode and cathode.
A triac behaves like 2 SCRs back-to-back. The terminals are not anode and cathode, but instead, are called Main Terminal 1 (MT1) and Main Terminal 2 (MT2).
Now, think about about the AC cycle. What happens at the end of every half-cycle? The voltage drops to zero, right? Therefore the current drops to zero, and the triac switches off. SO... to keep a triac in conduction, you have to keep triggering it every half-cycle.
There are lots of pre-cooked dimmer circuits around, using a triac. Here is one:
https://www.aaroncake.net/circuits/dimmer.htm
Good luck!