Andy was sentenced to life imprisonment and sent to Shawshank prison because he mistakenly became a wife killer. In prison, he and Reid became friends. He set up a new prison library and used his knowledge to help everyone manage their own finances. After discovering his financial expertise, the warden asked him to help him launder money and make false accounts.
Ending:
After Andy got out of prison, he took some of the black money saved by the warden and told on the truth of the warden's corruption and bribery. What the warden saw in the safe where he kept the small ledger was a Bible left by Andy. On the first page, it says, "The road to redemption is among them." In addition, there are hollowed-out parts in the Bible to hide pickaxes that dig holes.
After 40 years in prison, Rhett was finally released on parole. He found an iron box under the oak tree agreed with Andy, which contained some cash and a personal letter from Andy. Two old friends finally reunited on the blue Pacific coast.