a/b mod m for m not prime

Is there any way to calculate a/b mod m for m not prime . if there is , then can anyone please post the code or logic .