In Safari for OS X, you have a few options to close tabs simultaneously. Pick whichever one you’ll remember most or seems easiest to you:

Right-click on a tab and choose “Close other tabs.” Hold down the Option key and click the X button on the tab you want to keep open.

Use the Command+Option+W keyboard shortcut.

All of the actions above will close all of the tabs except the active one or the tab you select. If you want to close all tabs, including the active one, click Command+Shift+W. This will close the current Safari window, while keeping Safari open (handy if you have multiple Safari browser windows open).

How To Display Two Safari Tabs Simultaneously on the iPadHow to Pin a Tab in SafariHow to Block Cookies in Safari