Contacts are kept in a database, but go to
Google Contacts, More, Restore contacts, and you should be able to restore any contacts deleted within the past month.
Music, photos and videos are individual files, and the phone has to be rooted to restore them. (
Any Linux device [and Linux is the operating system for Android phones] is the same - you have to run su to undelete files [and "running su" is the same as "getting root on an Android device]. The app requests it by calling su, the superuser app [SuperUser, SuperSU or whichever one you'd have on your phone] just keeps track of which apps you've allowed to use su. [So if a virus tries to destroy your phone, you say "no" and it can't.]))
Apps are installed, you can't delete them, you'd have to uninstall them. If they're deleted from your home pages, just go to the app drawer, find an app that's missing from a home page, long-press it and, while keeping it pressed, move it to the home page.