I have figured out that $|A \cup B| = |A| + |B| - |A \cap B| $
and that
$|A \cup B \cup C| = |A| + |B| + |C| - |A \cap B| - |A \cap C| - |B \cap C| + |A \cap B \cap C|$.
I have not managed to figure out what $|A \cup B \cup C \cup D|$ is equal to. What is the cardinality of $A \cup B \cup C \cup D$?
Furthermore, how can one the generalized question: What is the cardinality of the union $A_1 \cup A_2 \cup ... \cup A_n$?
The general fact you are looking for is called the Inclusion-Exclusion Principle, and is characterized by the kinds of alternating sums you've noticed already.
The Wikipedia page on this theorem contains a proof, as well as some explanations.