Could somebody tell me if vaseline will help fight infection if I cut myself to the bone?

No. It has more potential to trap bad bacteria in the wound and has not antimicrobial properties at all. You have around 2 trillion (yes that is trillion) bacteria living on you at any time. Only takes one to get past your defenses to create an infection. Intact skin is an incredible barrier vaseline is not.
Vasoline. Vasoline will not directly help fight infection in a cut to the bone. It will provide a moisture barrier for the wound. In wound care, we like the concept of moist healing. However, any cut that makes it as deep as bone requires a visit to a clinician to make sure the wound base is clean. In addition, we have many products to place into the wounds that are better than vasoline.