How to let animation play before you can hit the attack button again

Hello, So the problem is that someone can spam the attack button which I don’t want. I want the animation to finish before they can hit the attack button again. I’m very new to this so please give a detailed repose and a screenshot would help too. Thank you