The ModInverse Function

I didn’t understand the modInverse() function and why we are using it?

Becaues we have y=(p’’/d’’ ) and we are writing it as

y=(p’’) * (d’’)^-1.

My question is that can’t we just calculate (p’’/d’’)
instead of doing (p’’) * (d’’)^-1. ?

y=(p’’) * (d’’)^-1 and y=(p’’/d’’ )
both are the same