All the solutions to this I found online were either unnecessarily wordy or confusing due to formatting/syntactical issues. So, I'm adding mine which I will try to keep short and clear.

The Problem: You are given 12 balls. All of them are identical except one, which is either heavier or lighter than the rest. You are given a simple two-arm balance scale, which you can only use three times. How do you identify the odd ball, and whether it is lighter or heavier?

Solution: Divide balls into three equal groups (A,B,C) and number them (1-4) in each group.

Step 1. Weigh Group A against Group B:

They balance => Odd ball is in Group CStep 2. Weigh [C1, C2, C3] against any three normal balls (from groups A or B since they don't contain the odd ball).

They balance => C4 is oddStep 3. Weigh C4 against any other ball to see if it is lighter or heavier.

[C1, C2, C3] heavier => One of [C1, C2, C3] is heavierStep 3. Weigh C1 against C2. The heavier one is the odd ball, otherwise C3 is heavier.

Normal balls heavier => One of [C1, C2, C3] is lighterStep 3. Weigh C1 against C2. The lighter one is the odd ball, otherwise C3 is lighter.

Group A heavier => Either Group A contains a heavier ball or Group B has a lighter oneStep 2. Replace [B1, B2, B3] with three normal balls (let's say [C1,C2,C3] and swap A4 with B4. In other words, weigh [A1, A2, A3, B4] against [C1, C2, C3, A4].

They balance => One of the removed balls [B1, B2, B3] was lighterStep 3. Weigh B1 against B2. The lighter one is the odd ball, otherwise B3 is lighter.