Help! My car dies while driving and won't start!

It wouldn’t start when I tried to restart it like the engine wouldn’t turn over. The lights and stuff work so I don’t think it’s the battery. I get a kind of clicking/grinding noise when I try to start it.