Use a heavy-duty outdoor extension cord in the garage.
Don’t risk a cheap indoor cord. Garage floors are hostile environments—oil soaks into the jacket, chemicals weaken the insulation, and vehicle tires crush the wire until it shorts or catches fire.
Get a cord rated for outdoor use with a thick, oil-resistant jacket (look for SJTW or similar marking). 12-gauge is safer than 14-gauge for longer runs or tools. Keep it off the floor when possible—hang it from hooks or run it along the wall. If it has to cross the floor, use a cord protector ramp so tires don’t pinch it.
A few extra dollars now beats replacing a tool—or a garage.