Defragmenting Stopped Crashing My Hard Drive

Hello!
I was defragmenting my hard drive then suddenly windows restarted itself ! now i can't open my computer it can detect the hard drive but it can't boot!
Ii tried to reinstall windows but it cant continue i can't even create or modify a partition !
what should i do?
I have important files or on that hard drive!
