Fiction is writing invented from the imagination — stories, plays, and poems with made-up characters, settings, and events. Nonfiction (often written non-fiction) is writing grounded in facts about real people, places, or information, such as newspapers, reference books, biographies, and instructional guides.
BBC Bitesize puts the contrast simply: fiction needs imagination, while a nonfiction book is about facts you cannot invent. Fiction often aims to entertain or explore themes through creative storytelling; nonfiction aims to inform, explain, or document what is true (BBC Bitesize).
Source: BBC Bitesize: What are fiction and non-fiction?
Image: Open book, photo by Ben White (benwhitephotography), CC0, via Wikimedia Commons.