In 'The Master and Margarita', the character who writes a novel about Pontius Pilate is the Master.
The Master is a former historian who wins money in a lottery and uses it to devote himself to writing about Pontius Pilate and Yeshua Ha-Notsri, Bulgakov's name for Jesus. His manuscript becomes the novel-within-the-novel, recounting Pilate's moral crisis after sentencing Yeshua.
The Master is not Mikhail Bulgakov himself, although he is widely read as an author surrogate. Like Bulgakov, he faces hostile literary critics and Soviet censorship. The rejection and public attacks drive him to burn the manuscript and enter a psychiatric clinic, where he meets Ivan Bezdomny.
A common mix-up is Woland: he knows the Jerusalem events and may have witnessed them, but he does not write the manuscript. Margarita protects and restores the Master's work, while Ivan becomes its important witness and future custodian.