Paste the following code on top of your main template file (ex. index.php):

JHTML::_('behavior.modal','a.mymodal');

The word mymodal can be any word that you like to use as your modal class.

Then, use the link in the following format in your article or page.

<a class="mymodal" href="/images/image.jpg">Image or Text for a popup</a>