2012 Hyundai Sonata - Rattling and Knocking Noise

My car broke down two days ago. I was driving when I heard a loud rattling, knocking sound coming from the engine. I think it’s the engine. Then the car stopped moving and I couldn’t get it to run. When I crank it, I hear the noise and then the car shuts off on its own. Does anyone have an idea of what the problem may be? Is the car fixable? Would it be too expensive?

Fixable probably . Expensive most likely. This is going to take a shop to have it in their possession to determine the damage. It will require towing charges - diagnostic fee - and then a decision by you it you want to spend the amount of money it will take to put it back on the road.

is oil level good on dipstick?
how many miles on car?