How does the French election work?

President Emmanuel Macron shocked the country when he called a national election on June 9