Abbé Faria is a fictionalized version of a historical person in the 1844 adventure novel The Count of Monte Cristo by Alexandre Dumas (père) and its various adaptations. In all of them, he's a fellow prisoner and mentor of Edmond Dantès, for whom he tells of a large hidden treasure of Monte Cristo.
Abbé Faria is an Italian priest and a highly learned man, imprisoned in Chateau d'If since the year 1811. Before that, he was imprisoned for three years in the Fenestrelle Fortress. This was apparently because he supported Napoleon Bonaparte. While he worked under Cardinal Spada, he discovered the existence of a vast family treasure hidden in the island of Monte Cristo. During his imprisonment in Chateau d'If, he tried continuously to buy his freedom with the location of said treasure, but he was deemed insane and placed in solitary confinement in 1813. In there, he puts his knowledge to good use, and with resourcefulness and ingeniousness, he creates for himself various tools with what limited materials his cell has to offer, managing even to write a book about Italian politics. Despite his reputation as the amusing "mad monk", he's known by the prison staff as a pious, wise and gentle man (which shows for example in his unwillingness to kill a guard even for a chance to escape and his act of ordering a medicine which heals the governor's wife).
In 1821, while Faria is digging an escape tunnel, he meets Edmond Dantès, another prisoner isolated since coming to Chateau d'If in 1815 after being framed as a Bonapartist. The two prisoners become close friends, and inspired by the example of the resolute and resourceful priest, Dantès gains new hope of freedom and is pulled from his suicidal thoughts. They spend the following years trying to dig an escape tunnel, and Faria teaches Dantès all he knows about a variety of subjects (like sciences and foreign languages) and helps him uncover the reasons behind his imprisonment. Faria regrets this latter act because Dantès becomes obsessed with getting revenge on those who framed him.
In 1829, fourteen years since Dantès' imprisonment, Faria becomes fatally ill with cataleptic seizures before the escape tunnel can be finished. Before dying, he tells Dantès the location of Monte Cristo's hidden treasure, hoping that the younger man the priest has come to regard as his son can escape, find the treasure and use it to rebuild his life. Dantès escapes by impersonating as his dead friend's body, leading him to be thrown into the sea and getting rescued by a smuggling ship.
Eventually Dantès journeys to the island of Monte Cristo and finds the treasure, becoming very wealthy. Instead of following Faria's advice of finding happiness, Dantès uses his wealth to prepare for having his revenge (though he does aid those who tried to aid him). One of the false identities created by the so-called Count of Monte Cristo, an Italian priest called Abbé Busoni, is a possible homage to his dead friend. In 1838, after having his revenge on two of his enemies and causing some collateral damage he regrets, Dantès finally understands what Faria tried to tell him about forgiveness. He visits Chateau d'If and recovers Faria's book, after which he has his revenge on his final enemy by driving him to rue his sins, allowing him live after that.