How does anaerobic bacteria get in our system?

Already here. Our bodies have natural sources of anaerobic bacteria, usually from our gut (all the way from mouth to anus). Infections are either from these, or from traumatic implantation with a deep wound.