Trouble understanding equivalence relations and equivalence classes
Here are two examples :
$1 - $ Consider the relation $\equiv$ ( an equivalent relation), then
$$a \sim b \Leftrightarrow a\equiv b \mod 2 $$
That is, $a$ and $b$ will be in the same class $\overline{a}$ if their remainders of the division by $2$ are the same. For example $4$ and $6$ belong to the same class, which we are going to choose a representant $0$, because
$$6 = 3 \dot \ 2 + \color{red}{0} \ \ \text{and} \ \ 4 = 2 \dot \ 2 + \color{red}{0}$$
then we say $\overline{4} = \overline{6} = \overline{0}$. If we think, there are two distinct classes: $$\overline{0} = \{x \in \mathbb Z ; x \equiv 0 \mod 2, \text{x is even}\}\ \ \text{and}\ \ \overline{1} = \{x \in \mathbb Z ; x \equiv 1 \mod 2, \text{x is odd}\}$$
The set of all classes is
$$\mathbb Z_2 = \{\overline{0}, \overline{1}\}$$
$2-$ Consider the relation
$$(a,b) \sim (c,d) \Leftrightarrow ac = bd $$
This equivalent relation gives us the fractions, that is the filed of fractions of $\mathbb Z$. Similarly we choose a class representant for example,
$$\frac{1}{2} = \frac{2}{4} = \frac{3}{6 } = \cdots$$
we choose $\frac{1}{2}$ to be the class representant. Notice that $\mathbb Q = \{ \frac{a}{b} ; a,b \in \mathbb Z, \ \ \text{where}\ \ b \neq 0\}$ is the set of all classes.
Following is an elaborate example that will help solidify the concept of partitions, equivalence classes and equivalence relations.
A mathematician has quite a bit of stuff in his garage (in an objective assessment, some of it would be called junk). In fact, it has been so long since he has even stepped inside it, that he realizes that the items form an amorphous set that he denotes by $J$, and he can only classify the items with the coarsest partition, $\{J\}$. Not much to say about all that junk in the garage.
One day he decides to tackle this problem. He starts by labeling the items with stickies and indexing the labels with $\{1,2,\dots,n\}$. He also write down on a piece of paper a descriptions for each index,
$\quad 1: \text{Dull screwdriver with blue handle}$
$\quad 2: \text{Empty coffee can}$
$\quad etc.$
He now feels comfortable by defining the 'finest' partition consisting of all the singleton sets
$\{1\}$, $\{2\}$, $\dots$, and $\{n\}$. He also starts to use colored markers on the list to group items together that exhibit some affinity, at least in his mind.
Weeks later he has finished his goal. He hires a carpenter to put up five shelves, $A, B, C, D, E$ in his garage. When the work is completed he goes into the garage and puts every item on his list on one of the five shelves.
Of course since he is mathematician he looks at the equivalence relation he has created,
$\quad j \sim k \text{ iff } k \text{ is on the same shelf as } j$
He goes back to thinking about more interesting things, but years later he needs a screwdriver. Unfortunately he can't find that marked up paper and has no idea what shelf the screwdriver is on.