Hello and welcome to JustAnswer!
Are you hearing a single solid click from the engine compartment? If it's a single solid click it could be a connection issue but it's more likely the starter itself. It's not uncommon for bad starter solenoid contacts to cause this, the drive gear will kick out but bad contacts will prevent the starter motor from running. This is often intermittent at first and gets worse over time.
If it's the starter you can often tap on the starter with a hammer while a helper tries to crank the engine, this will often get it to crank again.
If you're hearing a rapid series of clicks that sounds somewhat like a machine gun then that's a sign of very low battery voltage at the starter. If you don't eventually have to jump start it to get it to start then you either have a connection problem somewhere or voltage drop in a cable. Start by checking battery connections, which I hope has already been done, the starter positive connection and engine ground should also be checked.
Something that you can do when it acts up is use jumper cables to go from the battery negative terminal to the engine block. If this allows it to crank then the problem is with the engine ground or cable.
You can do the same between the positive battery terminal and starter positive terminal if you're able to access the starter.