This is a story about Harold Crick and his wristwatch. Harold Crick is an obsessively neat IRS agent, which infuriates his watch.
Soon after the watch incident, Harold starts hearing a woman's voice narrating his life, which also predicts his "imminent" death. Psychiatrists attribute it to schizophrenia, so he asks a literary professor named Jules Hilbert to help him.
Meanwhile, he has to audit Ana Pascal, a baker who refuses to pay the part of her taxes that go to corporate sponsorship. Ana quickly decides that she hates Harold, but Harold has developed a crush on her.
The author, Karen Eiffel, is having writer's block, trying to figure out what Harold's imminent death is.
Professor Hilbert gets Harold to try a number of experiments to determine whether his story is a comedy or tragedy, and Harold eventually determines that it's a comedy because of a romantic encounter he has with Ana. Hilbert, however, thinks that in order for it to be a comedy, Harold should pursue his dream, so Harold goes out and buys an old used Fender Stratocaster.
Karen, meanwhile, stumbles across the perfect ending to her book. At around the same time, Harold and Ana sleep together, and Harold finds out through an old tax return that Karen Eiffel is the author, so he calls her. She's distraught when she meets Harold, and is worried that all the other characters she's killed in her other books might have been real, too.
Karen gives Harold an early draft of the book, including the ending where he dies. He's too afraid to read it, so he gets Hilbert to read it, who thinks it's one of the greatest endings ever written and that Harold has to die. Harold reads it, and feels the same way.
The next day, because of his wristwatch's error, Harold, normally on time, is three minutes early for the bus. Since he read ahead, he knows his death is closing in.