P(B|A)=P(AB)/P(A)
If A and B are independent of each other (the appearance of AB does not affect each other), P(AB)=P(A)P(B)
In high school topics, it is generally said that A and B are independent of each other.
P (b | a) = p (ab)/p (a) = [n (ab)/ntotal]/[n (a)/ntotal] = n (ab)/n (a), where n represents the number of events.
Sometimes it is easier to use this formula.
I hope I can help you!