The category $\mathbf{Grp}$ of groups has a zero object, namely the trivial group $1$. Since $\mathbf{Grp}$ is furthermore complete, we have the notion of a kernel of a group homomorphism. The kernel of a homomorphism $G\xrightarrow{\ f\ }H$ is a monomorphism $\operatorname{Ker}f\xrightarrow{\ker f}G$, so $\operatorname{Ker}f$ can be interpreted as a subgroup of $G$ with underlying set a subset of $G$. Namely, $\operatorname{Ker}f=\{x\in G\mid fx=1\}$.
In the category $\mathbf{Ring}$ of rings, we don't have a zero object and thus there is no natural definition of a kernel. Anyway, we define the kernel of a ring homomorphism $R\xrightarrow{\ f\ }S$ as the set $\operatorname{Ker}f=\{x\in R\mid fx=0\}$, analogous to the case of (additive) groups. However, it is not clear to me, what kind of object this is, i.e. to which category it belongs.
It seems wrong to think of it as a set, because it does have extra structure, e.g. as an (abelian) group. So maybe one should define the kernel of a ring homomorphism as an abelian group (the kernel of the underlying group homomorphism). But also this seems a little arbitrary, because one can easily define Rings and kernels of such without ever coming across abelian groups. Also, this doesn't give rise to a one-to-one correspondence, since not every kernel of a homomorphism of underlying abelian groups gives rise to a kernel of a ring homomorphism.
So, is it possible to define a kernel of a ring homomorphism without "leaving" the category of rings?
The same problem comes with all ideals. Is an ideal a set? A group? An abelian group? A module? A non-unitary ring? If one indeed defines left-ideals of $R$ as submodules of $R$, viewed as a left-module over itself, a right-ideal as a left-ideal of $R^{\operatorname{op}}$ and a two-sided ideal as a left-and-right ideal, how does this intuitively give rise to the fact that
two-sided-ideal$\iff$kernel of underlying group homomorphism of some ring homomorphism?
I hope you can understand the trouble I have.
A left ideal of a ring $R$ is just a left $R$-submodule of $R$. Thus, the natural category in which left ideals live is the category of left modules. The latter has a zero object and kernels can be computed as usual. If $f : R \to S$ is a homomorphism of rings, you can view $S$ as an left $R$-module via $r s := f(r) s$, so that $f$ becomes a homomorphism of left $R$-modules and the kernel of this homomorphism (in the category of left $R$-modules) is what you usually call the kernel of the ring homomorphism of $f$. Similarly we can deal with right ideals. And for two-sided ideals we work with the category of $(R,R)$-bimodules and observe that every ring homomorphism $R \to S$ induces an $(R,R)$-bimodule structure on $S$. By the way, all these definitions also work when we replace $\mathsf{Ab}$ by any abelian tensor category. For example, (quasi-coherent) ideal sheaves also fit into this picture.