You can restore your Mac using Time Machine and an external hard drive. Time Machine automatically creates backups of your Mac every hour.
You can recover deleted photos on iPhone from the Recently Deleted folder in the Photos app or a backup on iCloud, iTunes, or ...