How to do custom alert boxes?

I was taking course of JavaScript on freecodecamp , and I wanted to know if there is a way to create custom alert boxes?
The default alert boxes are very dull and not aesthetically appealing.

Counterpoint: everyone knows what they are and how they work and they are built into and work perfectly in any platform (pc, phone, tablet, watch etc).

With custom alerts, it is just a case of showing/hiding an HTML element that you’ve styled, for example: