I am having some trouble understanding the concept of a prime ideal in ring theory. I have researched what a prime ideal is and the simplest answer I got was this:
An ideal $P$ of a commutative ring $R$ is prime if it has the following two properties:
If $a$ and $b$ are two elements of $R$ such that their product $ab$ is an element of $P$, then $a$ is in $P$ or $b$ is in $P$,
$P$ is not equal to the whole ring $R$.
Then it goes on to say that in the ring of integers, $n$ is prime if and only if $n \Bbb Z$ is a prime ideal of $\Bbb Z$.
I tried to grasp the concept by visualizing an example where $a=4$ and $b=6$ and their product $ab=24$, they are both in $\Bbb Z$ and their product is in $4 \Bbb Z$ so shouldn't that imply that $4 \Bbb Z$ is a prime ideal? Which does not fit well with the condition of $n$ being prime if and only if $n \Bbb Z$ is a prime ideal, since $4$ is not a prime number.
In your attempted counterexample, we have the ideal $I=4\mathbb{Z}$ of the ring $R=\mathbb{Z}$, and the two elements of the ring $a=4$ and $b=6$. Certainly it's true that $4\mathbb{Z}$ is not the entire ring $\mathbb{Z}$, and you're correct that this statement is true: $$\underbrace{4\cdot 6\in 4\mathbb{Z}}_{\mathsf{True}}\implies \underbrace{4\in 4\mathbb{Z}}_{\mathsf{True}}\;\text{ or }\;\underbrace{6\in 4\mathbb{Z}}_{\mathsf{False}}$$ However, in order for $I$ to be prime, we need $$ab\in I\implies a\in I\text{ or }b\in I$$ to be true for every elements $a,b\in \mathbb{Z}$. What happens when $a=b=2$?