A zombie virus has spread. A diary is usually a small book where one can write their thoughts. The person writing the diary writes about the virus and how it is infecting him. This is used to provide some insight to the player on how the world reacted to the zombie infestation. The person writes about how they are beginning to feel sick, how they have a sudden craving for human flesh. As they begin to lose their sanity, their writing becomes more and more disjointed and crazy, sometimes not even making any sense, ending on a few disjointed lines written just before the poor victim lost their minds entirely, and with it the ability to continue writing.
The most famous occurrence of this concept is in Resident Evil. The player reads the 'Keeper's Diary', a diary of a man slowly turning into a zombie. The final lines are,
Fever gone but itchy. Hungry and eat doggy food. Itchy Itchy Scott came. Ugly face so killed him. Tasty. Itchy. Tasty.
What's left of the man then lunges out of what can only be described as a literal Monster Closet.
See also: Dear Diary, I'm Being Murdered, a similar gameplay element which allows players to experience someone's untimely death after the fact.