I am studying ring theory from Herstein's book and ran into the definition of prime element but I have some difficulties in order to comprehend it's essence.
For example, in the ring of integers the set of $\{\pm 2,\pm 3,\pm5,\pm 5,\dots\}$ - prime elements.
If $R$ is Euclidean ring, consider the nonunit element $\pi\in R-\{0\}$. We call this element prime if $\pi=ab, \ a,b\in R$ then one of them is unit in $R$.
Can anyone explain this definition with some example? Especially, why one of them should be the unit in $R$?
I would be very thankful for that!

Units are elements with multiplicative inverses, in $\mathbb{Z}$ there are only two: $-1$ and $1$.
Let's try and write down all factorizations $\pi = ab$ we can think of in $\mathbb{Z}$ of the element $\pi = -3$.
Maybe you can cook up some others, but I could only find four:
$a = -1$, $b = 3$;
$a = -3$, $b = 1$;
$a = 3$, $b = -1$ and
$a = 1$, $b = -3$.
Now we notice that in all cases a unit (either $1$ or $-1$) shows up as either $a$ or $b$, so we conclude that $-3$ satisfies the definition of prime number.
By contrast: writing all factorizations of $\pi = 4$ we find that there are six. Most of them still have a unit (either $-1$ or $1$) as a factor, but there are two that don't: $a = 2, b = 2$ and $a = -2, b = -2$. This is enough to conclude that $4$ is not prime.
Now perhaps your question is: why not use the 'standard' definition of 'prime', that we learn for positive integers: 'the only way to write $\pi = ab$ is when either $a$ or $b$ equals $\pi$ itself'? The reason is of course, this is no longer true when we allow negative integers and get stuff like $3 = -1 \times -3$.
However, here we see the 'units' already lurking around the corner. I mean, sure 'technically' the $-3$ is a different number than $3$, but 'morally' it is just the $3$ in disguise. We could modify the definition of prime to accommodate this sentiment as follows:
'a non-unit $\pi$ in a Euclidean ring is prime if whenever $\pi = ab$ we have that either $a$ or $b$ equals a unit times $\pi$.'
It is a nice exercise to check that this is indeed equivalent to the definition from the book.
(Final unrelated remark: in general rings elements with this property are called irreducible and the term prime is reserved for elements with a different property. In Euclidean rings however the properties of being irreducible and being prime (in the other definition which I did not give here) are equivalent so the use of the word prime by the book in this context is justified. Still it makes me feel a bit uncomfortable.)