Injuries that prevent you from running suck. It’s easy to get mad and say screw training until it’s healed.
Once you get over the frustration, it’s a great opportunity to build or maintain fitness with other methods.
Bike, elliptical, rower, whatever the injury allows is an excellent alternative to running.
It may shift expectations for your race, or cancel it all together. But that’s why endurance is a long game. There will be more opportunities after the injury.