In software you need to have a avg tune up 2017 or any other related software cleaner for cleaning the registry errors, de-fragmentation of the disk, cleaning a wastes on your computer like broken shortcuts, internet cache, temporary files, and any other files that is using memory. Putting a Legit antivirus like avg internet security pro is the best as far as i know.
In hardware you computer should be placed in a well ventilated area and you should clean it regularly avoid having a dust from fan it will cause of cooling failure. always clean your system case to make it looks new, always check the thermal paste change it if it's years or half a year old.