Michelina Lewandowska, 27, said she prayed to God as she struggled to escape.
She told the jury at Leeds Crown Court that she had been placed in the box by her partner, after he had allegedly attacked her with a Taser at their home in Huddersfield and bound and gagged her with tape.
Marcin Kasprzak, 25, with whom she has a three-year-old son, is on trial with another man Patryk Borys, 18, charged with attempted murder. They deny the charges.
The court was told Ms Lewandowska was placed in the boot of a car by the two men and driven to a wooded area where the box was buried in a shallow grave with a tree branch placed on top.
Miss Lewandowska, who is Polish and who spoke through an interpreter, said: “I thought about my ring, that I could take it off my finger and try to cut through the tape with it. I cut the tape from my legs with this ring. I put the ring back on my finger then I put my whole hand through the opening.”
She started to “tear the box apart” as she struggled to break free. “I was trying to estimate how much soil was on the box and I think it was 10cm. It could have been more,” she said.
“I managed to tear a little apart from this little opening. Then I thought the next thing is to cut the tape because there was no other way to get out.
“I put the tape from my face on to my legs and I started to tear the box apart. I was focusing on the hole I had just made. I took my head out from the box through the hole and at that point the soil was getting in.”
She said that after freeing herself, she flagged down a passing motorist.
The trial continues.