This is a very interesting question. Clearly we cannot know for sure if Coleridge was actually sharing some of his own experiences through this marvellous poem, but perhaps we can speculate at some parallels that he may have unwittingly created. Samuel Taylor Coleridge is famous not only for his poetry but also for his addiction to opium, which of course helped inspire some of his work, most famously "Kubla Khan." Because of his addiction, Coleridge, like the Mariner, was often wracked with physical pain and spiritual guilt. In the letters that he wrote about his addiction, Coleridge shows himself to be filled with shame and often hovers on the verge of despair. However, he refused to give in to this despair as he believed that this would be an even greater sin. Like the Mariner, he ultimately placed his faith in God to preserve him.
The albatross seems to function in the poem as a symbol of guilt, and so perhaps we are able to draw this parallel into the life of the author of this poem. The "albatross" that Samuel Taylor Coleridge had hanging around his neck is his own opium addiction. Unfortunately, it was not as easy for the author to rid himself of his own albatross.
“The Rime of the Ancient Mariner,” published in 1798, is Samuel Taylor Coleridge’s longest major poem. The conflict of the narrative poem begins when the mariner shoots the albatross who had just led the ship to safety. Not only is the ship’s crew angry with him but the mariner also faces the wrath of the spirits who seek to punish him for this act. The crew forces the mariner to wear the dead bird around his neck as a sign of penance and regret. Later, the ghostly spirits Death and “Night-mare Life-in-Death” curse all the crew members to die, but the mariner lives on, having to bear the burden of guilt. The mariner is forced to wander the earth, telling his story over and over.
While inspiration for the poem was likely drawn from several sources, including James Cook's second voyage to the South Seas and the book A Voyage Round the World by Way of the Great South Sea, in which a sailor shoots an albatross. Coleridge’s own life may have inspired the poem as well. George Whalley’s 1947 essay “The Mariner and the Albatross” argues that the Ancient Mariner could represent an autobiographical depiction of Coleridge. The poet’s letters and journals reveal loneliness similar to that expressed by the mariner. Additionally, religious themes of the poem related to guilt and redemption may have been influenced by Coleridge’s exploration of theological ideas at Jesus College. He was rumored to experience severe depression and was even discharged briefly from school by his brothers under the reason of “insanity.” These elements of Coleridge’s life likely influenced the creation of the tortured mariner character.