You will use driver.get() and instead of using a url you will specify the path where your file is. Here is an example:-
System.setProperty("webdriver.chrome.driver","C:\\Users\\Downloads\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("C:\\Users\\Desktop\\test.html");