There are a few ways to find the serial number but the easiest is to go to the Apple Menu and choose About This Mac. If you’re using OS X 10.8.x, you can click where it says “Version 10.8.5” and see it change to the software build (detailed version)… click again and it shows your Mac’s serial number.
If you’re using Yosemite or newer, you’ll find the serial number in the first About This Mac box that comes up. No need to click anywhere.
Want to do it the hard way? Look under your iMac’s foot. Or on the underside of your laptop. Get a magnifying glass.