There are different types of wait you can use :
Waits in selenium
You can use implicit wait like this:
System.setProperty("webdriver.chrome.driver","Your\\path\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.manage().timeouts().implicitlyWait(TimeOut, TimeUnit.SECONDS);
You can also explicit wait like this :
System.setProperty("webdriver.chrome.driver","Your\\path\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
WebDriverWait wait = new WebDriverWait(WebDriverRefrence,TimeOut)
You can use the following methods to wait that is basically used to put you thread to sleep and also causes an Interrupted Exception so in order to handle the exception we use:
public static void main(String[] args) throws InterruptedException
{
System.setProperty("webdriver.chrome.driver","Your\\path\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("https://www.google.com");//Open google
Thread.sleep(5000);// here time is in miliseconds so 5000 is 5 second and it will wait 5 seconds
driver.close();//close the browser
}
Hope this helps.