How does a Depo shot work ?

So I just had sex recently and the person pre-cum would I get pregnant from it ?