I am trying to remember the name of a book (it's also possibly a short story) that I read in high school. In this writing all the people have died due to a nuclear blast (I think) but the Earth itself lives on. The houses function and the food cooks itself, and everything still happens but without people.
I believe you’re thinking of “There Will Come Soft Rains,” a short story by Ray Bradbury. The house sits on the outskirts of a city that had been destroyed by a nucelear blast. Its residents were killed in the blast. The house continues to cook food and clean, even though it is unoccupied. As WhatRoughBeast said, the familiy’s starving dog returns home only to find it unoccupied and dies.
The story ends with
The house being destroyed by a fire, because it ran out of water to extinguish the fire.