Chief Miles OBrien is a fictional male Human engineer in the Star Trek - Deep Space Nine television series who was portrayed on screen by Colm Meaney. O'Brien used to be a small character in the Star Trek - The Next Generation, usually found at the helm of the transporter machine. When he was transferred to Deep Space Nine, his role became important. Onboard DS9, he got married and had a child.
O'Brien visits the planet Argrathi and when he asks too many questions, O'Brien is accused of being a spy and is arrested, found guity and punished. Punishment on Argrathi is different to how its done on Earth. Instead of being locked away, memories are implanted in the guilty. Instead of doing ten or so years for a crime, ten years worth of memories are implanted.
When Miles O'Brien returns to Deep Space 9, he has false jail time memories of which he has to learn to cope with. At the start, his colleagues do not suspect anything wrong but overtime his manner being eratic and becomes a cause for concern.
Of the memories implanted is of a person called Ee'Char who is based on his wife. Miles kiilled Ee'char over bread whilst in the fake prison. He sees Ee'char everywhere on DS9. Captain Benjamin Sisko relieves Miles of duty. Eventually, when Miles decides to take his own life, Dr. Julian Bashir steps up and begins steps to cure him.