Matthew Fulleylove, 30, had been working at Treanor Pujol, which makes concrete beams on Pontefract Road, when the accident happened on June 5, 2014.
An investigation by the Health and Safety Executive (HSE) was launched following his death.
His colleague, Steven Cooper, gave evidence on the first morning of a jury inquest at Wakefield Coroner’s Court today.
He said that Mr Fulleylove, of Ash Court, Killingbeck, had started work at the factory at 5am that day and had been working as a bed cleaner on one of the many tracks that produces concrete beams.
Later that morning Mr Cooper said he had seen Mr Fulleylove as he worked and then a few seconds later noticed that we has bent over “like he was picking something up” and that he “didn’t look right”.
It was then he realised Mr Fulleylove had become trapped.
Workers were able to free him and Mr Cooper then tried to revive him.
He said: “We got him out but we could see the mess he was in.
“I started CPR until the paramedics and the air ambulance came, and they told me to stop.”
He said that Mr Fulleylove had obvious and serious head injuries.
He was pronounced dead at 12.01pm that day.
The inquest is expected to last four days.