In this video, I have explained in detailed on how to handle alerts in Selenium using different WebDriver commands.
Also, refer to the notes which I have used for answering this interview question "How to handle alerts in Selenium WebDriver?" here