Sometimes distinguishing can be very difficult. One factor is the type of injury, for example, a sudden twist where you feel a "pull" might suggest a muscle or a joint ligament or a fall onto a hand or wrist would be concerning for a bone injury. Another factor is the location of pain. Another factor is what the pain feels like--some joint injuries give a dull ache versus a muscle or bone injury might be more sharp. Swelling, bruising, redness, etc. are other clues.
Sometimes, it's just flat out tough to tell without seeing a sports medicine or orthopedic specialist for a checkup or testing (e.g. x-rays). We're always happy to help.