
versagen
to fail
To not perform the expected function or service; to not work as intended.
Mitten auf der Autobahn hat der Motor versagt.
The engine failed in the middle of the highway.
to fail / to deny
Loading your saved state.

to fail
To not perform the expected function or service; to not work as intended.
Mitten auf der Autobahn hat der Motor versagt.
The engine failed in the middle of the highway.

to fail
To not fulfill a given task or expectation; to fail personally.
Er hat bei der Prüfung völlig versagt, obwohl er viel gelernt hatte.
He completely failed the exam, even though he had studied a lot.

to deny someone something
To refuse or withhold from someone something they want or believe they have a right to.
Aus disziplinarischen Gründen wurde ihm der Ausgang versagt.
For disciplinary reasons, he was denied permission to go out.

one's voice fails
To suddenly be unable to speak, usually because of strong emotions such as grief, fear, or being moved.
Als er sich bedanken wollte, versagte ihm vor Rührung die Stimme.
When he wanted to say thank you, his voice failed him from emotion.
'Versagen' (to fail/to deny) is an inseparable verb. The prefix 'ver-' here, as with many other verbs such as 'verlieren' (to lose) and 'vergessen' (to forget), points to a negative result or a failure.
Er hat sich bei der Adresse verschrieben.
He wrote the address incorrectly.
The grammar helps distinguish the meanings. If 'versagen' (to fail) appears without an object, it means 'to fail' or 'to stop working.' If it appears with a dative and an accusative object, it means 'to deny/refuse.'
Die Bremsen haben versagt.
The brakes failed.
In the meaning 'to refuse/deny,' 'versagen' needs two objects: a person in the dative (the person to whom something is denied) and a thing in the accusative (what is denied).
Die Eltern versagten ihrem Sohn die Erlaubnis, auf die Party zu gehen.
The parents denied their son permission to go to the party.
The expression 'die Stimme versagt' (one's voice fails) is a fixed unit. The person who can no longer speak is often expressed with a dative pronoun.
Mitten in ihrer Rede versagte ihr die Stimme.
In the middle of her speech, her voice failed her.
to fail
Scheitern generally means not achieving a goal; external obstacles may also be decisive. Versagen focuses more on judging one’s own performance as inadequate. If a task could not be completed because of external circumstances, scheitern is more appropriate; when the cause is inadequate personal performance, use versagen.

Trotz guter Bedingungen versagte sie, weil sie sich nicht vorbereitet hatte.
Despite the favorable conditions, she failed because she had not prepared.
Trotz guter Vorbereitung scheiterte sie an den plötzlich geänderten Bedingungen.
Despite her thorough preparation, she failed because of the suddenly changed conditions.