How to optimise images for SEO?

Google’s CEO, Sundar Pichai, had to sit through an interview with Congress and explain the basics of why image results of the US President were returned when anyone Googled “idiot”. Meanwhile the rest of the internet was taking notes on how to optimize images for SEO.