First thing I'd do is to check the battery terminals and clean them anyway, even if they look good.
This type of behavior is very common with some corrosion in the battery terminals, causing poor electricity transfer to the starter.
Even if they look good, the corrosion could be limited to just between the terminals and the connections, and you might not see it without taking them off. Once they're off, you should clean them anyway with a little bit of wire brushing.
If that's not the problem, then you can look further, but corroded terminals or a low battery could cause the problem.