How to make a button open a small window within the html page

So you know how extensions work in Google, right? You click a button and it opens this small window within the internal webpage. I know how to make a button open an external window, but how do I make it work similarly to an extension. Basically, I’d like to have an html page where I can click a button and it’ll open a small popup of another .html file within the first html page. So it would be this: https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_popup but where it says “A Simple Popup!” it’s an .html page.