This question comes from the 2018 Putnam and can be found in the following link:
https://kskedlaya.org/putnam-archive/
So far, I got the following two equations using simple algebra:
(1) $2018a = b(3a - 2018)$
(2) $2018b = a(3b - 2018)$
Then, I divide (1) by $b$ and I divide (2) by $a$ to get
(3) $\frac{2018a}{b} = (3a - 2018)$
(4) $\frac{2018b}{a} = (3b - 2018)$
Multiplying (3) and (4) together, I get $(2018)^2 = (3a - 2018)(3b-2018)$
So $(2018\mod3)$ is congruent to $(2\mod3)$ and $(2\mod3)^2$ is congruent to $(1 \mod3)$. In the answer provided, I'm told that each of the factors is congruent to $(1\mod3)$. Do we not consider the case when both factors are congruent to $(2\mod3)$ because only $2$ satisfies this requirement, and
$2$ x $2 = 4$ is definitely not equal to $2018$?

You want to look at factorizations of $2018^2$ where each term $\equiv -2018 \equiv 1 \mod 3$. Since $2018 = 2 \times 1009$ with $1009$ prime, there are not too many solutions.