LOGIC GATES
Modern computers use transistors. They can only represent information in 2 states, on or off, known as binary. These two states can be interpreted as true or false, respectively. They can also be written as 1 or 0.
These two states can be interpreted as true or false, respectively. They can also be written as 1 or 0.

True and false values can be manipulated using a special branch of mathematics: boolean algebra.
In regular algebra, the values of variables are numbers. However, in boolean algebra, the values of variables are true or false, and operations are logical.
There are 3 fundamental operations in boolean algebra: NOT, AND, and OR. These boolean operations can easily be built using transistors, allowing them to perform logic. When these operations are built as transistor circuits, the circuits are referred to as "gates", as they control the flow of current.
A NOT operation takes a boolean value and flips it. It flips true to false and false to true.
Current
A NOT gate is represented by this symbol.

By modifying the output of a transistor, it can become a NOT gate.
When the input is on, the gate electrode becomes conductive, allowing current to flow from the top to the bottom into the ground. As a result, the output receives no current, and so is off.
When the input is off, the current is unable to go to ground, so it flows into the output, so the output is on.
When the input is on, the output is off. When the input is off, the output is on.
An AND operation takes 2 inputs but has a single output. The output is true only if both inputs are true.

By wiring 2 transistors together in series, they create an AND gate.
Current
An AND gate is represented by this symbol.
If transistor A is on and transistor B is off, the current is unable to flow from the left to the right. As a result, the output receives no current and is off.
The output will also be off if transistor A is off and transistor B is on, as the current is still unable to flow into the output. If both transistor A and B are off, the output will still be off.
Only if both transistor A and B are on will the current be able to flow into the output, turning it on.
An OR operation takes 2 inputs and has 1 output. Only 1 input has to be true for the output to be true.
An OR gate is represented by this symbol.

By wiring 2 transistors together in parallel, they create an OR gate.
If transistor A is on and transistor B is off, current is still able to flow to the output, so the output is on. The output is still on if transistor A is off and transistor B is on. The output is still on if both transistor A and B are on.
Only if both transistor A and B are off is the output off.
Now that we know how to build NOT, AND, and OR gates, we can use just their symbols to represent them.
By using these symbols, we can use them to build even more complex logic gates and components while keeping their diagrams relatively simple.
NOT, AND, and OR gates can be used to build NAND, NOR, XOR (X pronounced EX), and XNOR gates.
NAND

NOR

XOR

XNOR

Now that we know all of these more complex logic gates, we no longer have to worry about the individual logic gates that they're made of.
We also no longer have to worry about the individual transistors that make up logic gates.
This allows us to build even more complex components made up of logic gates.