Basically:
<div onclick="window.open('https://example.com/popup-content/')">Click Here</div>
That’s the traditional popup that opens in a new window. It has gotten a bad reputation over the years due to abuse, such that many forms of it are often blocked. Open on click should still work.
The “popups” you usually see these days are actually modals where the popup/modal content is part of the current page and hidden by default through CSS rules. When the click event fires, JavaScript alters the CSS to darken the main page and displays the popup over it. User interaction should be limited to the modal area. Clicking outside the modal could dismiss the modal as though ‘X’ or cancel were clicked.