I suppose with you mean the invertible elements of ? (I've seen different notation for that).
Anyway, since mod 3
For finding an arbitrary modular inverse (if it exists), there is an algorithm using the extended Euclidean algorithm, described here. Also, if you choose the method involving direct exponentiation using Euler's theorem, there are algorithms for fast modular exponentiation, one of which is described in this thread, posts #5 and #7.