Make a Time Machine backup, this may take some time to complete.
Power off your Mac. Hold down the Option and D keys on a wired keyboard and power up. Keep the keys held down until the Apple logo appears.
Choose Diagnose. This will check your hdd for errors. If the issue is hdd errors, replace the hdd and reload your OSX as detailed below.
Power off your Mac, with a wire keyboard (or use your USB cable), hold down the three keys; Command, Option and R. Power up the Mac and keep holding the keys down until the World Logo appears.
Follow the onscreen prompts to reload the OSX from Apples site.
When prompted select Restore Data from Time Machine.
That will give you a clean install of the latest OSX version and all of your apps and data will be restored without any errors, hopefully.