Check that your computer is compatible with Mountain Lion/Mavericks/Yosemite/El Capitan.
To check the model number hold down the option/alt key, go to the Apple menu and select System Information.
iMac (Mid 2007 or newer) model number 7,1 or higher
MacBook (Late 2008 Aluminum, or Early 2009 or newer) model number 5,1 or higher El Capitan requires early 2015
MacBook Pro (Mid/Late 2007 or newer) model number 3,1 or higher
MacBook Air (Late 2008 or newer) model number 2,1 or higher
Mac mini (Early 2009 or newer) model number 3,1 or higher
Mac Pro (Early 2008 or newer) model number 3,1 or higher
Xserve (Early 2009) model number 3,1 or higher
Your Mac needs:
OS X v10.6.8 or OS X Lion already installed
2 GB or more of memory (More is better - 4 GB minimum seems to be the consensus)
8 GB or more of available space
Check to make sure your applications are compatible. PowerPC applications are no longer supported after 10.6.
Applications Compatibility (2)
El Capitan 10.11 Compatibility information
macOS Sierra 10.12: Compatible Apps
Also check to make sure there is a compatible driver for your printer.
Do a backup before installing, preferable 2 backups on 2 different drives.