Gmail provides undo send feature by default. Right after you send an email, normally in the bottom left corner of your screen, you will see Message sent and also options to Undo or View message for 5 seconds. Click Undo to retract your email within that short period of time.
How to increase the amount of time to undo send in Gmail?
In Gmail, click the Settings gear icon at the top right corner and select Settings.
In the Settings page, under the General tab, you will see the Undo Send option.
Select a time from the Send cancellation period: dropdown box. Currently, you can choose 5, 10, 20, or 30 seconds. Once selected, scroll down and click Save Changes.
Also, learn how to set up undo send in Outlook.