Another failure mode that might be worth mentioning here: If the starter is just plain dead, then John’s test should point that out very quickly. But if the starter gear does come out and it spins, that does not necessarily mean the starter is good. The “clutch” built into the starter allows the engine to start and run faster than the starter, all good, but that clutch mechanism can also be bad and it won’t be obvious until you test the starter under some load on the gear (let a shop/store do that). A bad clutch in a starter will let the gear spin when in open air, but when in the car it does not have the ability to turn the engine at all or not very fast. Symptoms would be that you hear the starter motor running but when you look at the engine while starting the pulleys/belts aren’t moving or moving very slowly.
Doesn’t sound like this was your problem, but thought I should throw it out there in case.