Two answers here present two very different approaches to motivating ideals.
The first presents the historical motivation for ideals, namely Kummer's idea that in some rings like $\mathbb Z[\sqrt{-5}]$ there are somehow "ideal numbers" that allow us to factor products like $2 \cdot 3 = 6 = (1+\sqrt{-5})(1-\sqrt{-5})$ further, and more importantly, uniquely.
The second presents the completely abstract construction of an ideal $I$ of ring $R$ to be exactly a subset that $a \sim b \iff a-b\in I$ is an equivalence relation s.t. $R/{\sim}$ inherits the ring structure of $R$; or as that answer put it, "Equations in $R$ give corresponding equations between equivalence classes in $R/{\sim}$". An answer here phrased this quotient idea as "You can think of ideals as subsets that behave similarly to zero".
Again in Intuition behind "ideal", Qiaochu Yuan says "To me ideals are kernels of ring homomorphisms". This point of view is very connected to the quotient point of view presented above, essentially by the 1st isomorphism theorem. It also makes rigorous the above idea that "ideals are subsets that behave similarly to zero", since kernels are literally the set of elements that get mapped to $0$ by a ring homomorphism.
My question is how to connect this latter, more "abstract" point of view with the historical/Kummer-Dedekind point of view? I don't really have a good intuition/picture for why the set of all elements "divisible by some (ideal) number" should be exactly a subset of elements $S$ s.t. we can "do exactly the same kind of arithmetic" with cosets $\{r+S\}_{r\in R}$ as we can with elements $\{r\}_{r\in R}$.