Risk one’s neck to (do something)

To risk physical harm in order to do something.

I risked my neck in order to rescue the cat from the roof.