Because a dialog box is often needed and could be called from anywhere, you'd want to have a system that is generic.
For example, have a function name that you always use to show the dialog box.
You need a CSS file to control the styling of the modal.
You need JavaScript code to control the content and size of the dialog box.
You need a system for loading the CSS and JavaScript into your HTML before it loads.
I use scriptlets to build the HTML files before they are loaded.
I have my own dialog box system, but I don't have a tutorial or any open source repo for it.
I do use the W3 Schools CSS file, but then use my own JavaScript.
It's easier to use someone else's CSS system because everything is so interconnected, that you could spend years on developing it.
But the JavaScript is a little easier.
Do you already use jQuery or some other CSS/JS framework?