“If you make a typo or regret sending a message, you can undo the action by enabling “Undo send.” This setting gives you the option to take back a message you just sent.
To give you time to undo, Gmail delays sending the message for a few seconds. So if you don’t select “Undo” within the time limit, your message will be sent.”
The short video below shows how the “Undo Send” option works.
You can enable “Undo Send” in Gmail by clicking on the settings cog icon and checking the “Enable Undo Send” box like in the following picture: