Paul Connolly, director of Bushey-based PNT Contractors Ltd, had to be rescued by workers digging him out by hand after the collapse at a site in Essex in July 2014.
He was taken to hospital and suffered a broken leg and ankle.
Southend Magistrates’ Court heard that PNT Contractors was carrying out extensive ground work at a site in Crays Hills, Bilericay, when the incident took place.
Connolly had used an excavator to dig into the side of a slope, leaving unsupported excavation sides of up to 2.5 metres in height.
Connolly and another employee were working in the sheer-faced excavation when it collapsed.
The second worker managed to jump to safety but Connolly was partially buried and trapped by the falling earth and had to be dug out by hand by his two employees.
HSE served a prohibition notice the following day stopping any work until the excavation was made safe.
PNT Contractors of Bushey, Hertfordshire, was fined £15,000 and ordered to pay costs of £1,176 after admitting a breach of the CDM Regulations.
Connolly of Watford, was fined £15,000 and ordered to pay costs of £1,176 for a similar breach by virtue of being a director of the company.
After the hearing, HSE inspector Adam Hills said: “Paul Connolly not only endangered himself, but was reckless with the lives of his employees.
“Every year people are killed or seriously injured by collapsing trenches. The dangers here were obvious.
“A few simple and inexpensive precautions could have easily prevented this from occurring.
“To prevent a collapse you should shore, step, or batter back the sides. Do not assume ground will stand up unsupported.”