Essentials are things that will assure your safety and ability to finish the ride both ways under normal circumstances. That would be: lights (unless you never ride in the dark), a bell or a horn, spare tubes, patch kit (if you run out of spare tubes), and a pump and a helmet.
Then you have things that would make your ride more pleasant and easier: that's where I'd put a water bottle, a lock, fenders, racks, etc.
You should also have some stuff at home, as mentioned above, at least a floor pump, chain lube, chain/cog brush, some degreaser to clean the bike. And yeah, definitely learn how to fix a flat