The 40-year-old actress, who plays Michelle Connor in the ITV soap, said the scenes in which she and her on-screen partner Steve McDonald lost their baby at 23 weeks were “challenging”.
Marsh gave birth to Archie, who was her first child with her now ex-husband Jamie Lomas, in February 2009. Archie was born 19 weeks early and died shortly after he was born.
“I have had to go to some really dark places when filming the heartbreaking scenes,” Marsh told OK! Magazine. “But my family, friends and colleagues have been incredible.
“Losing a child is something that never leaves you.”
Marsh continued: “Revisiting those feelings as Michelle was a challenge. There was a counsellor on set at all times when we were filming the scenes.”
Marsh is also mum to David, 22 and Emilie, 18, with her former partner Dave Cunliffe and five-year-old Polly, with former partner Jamie Lomas.
“The best tonic was to go home and see David, Emilie and Polly, which reminded me how lucky I am to have my children,” she added.
The actress also took to Twitter on 31 December to thank those who have supported her with the storyline.
“We have all worked so hard on this and we hope that we can help make a difference both to families going through the same thing and to the wonderful organisations that try to raise awareness,” she wrote.
“I am eternally grateful to all those who have supported me personally through this and I hope I have done my angel proud.”
Marsh has previously opened up about losing her first child in a bid to raise awareness of miscarriage and stillbirth.
In August 2015, she shared a tribute to her son, writing: “For my Archie who we miss everyday. We love you. Remembering all the angel babies today.”
“I went through 24 hours of excruciating contractions and then with one final push Archie came into the world,” she said.
“He tried to take a breath and then he passed away. All I can remember then was silence. Absolute silence.”
The new issue of OK! magazine is out now.