Meaning trap
hang on
persist despite difficulty
to continue or persevere in a difficult or challenging situation, often when it would be easier to give up.

Don't mix these meanings
Same phrase, different job.
to continue or persevere in a difficult or challenging situation, often when it would be easier to give up.
'hang on' also has the more basic meaning 'wait for a short time'; this is the advanced sense.
Hear it in context
Notice where the phrase sounds natural.
Despite the setbacks, she managed to hang on until the end of the project.
In difficult economic climates, small businesses often have to hang on through periods of uncertainty in order to survive.
Fix the pattern
One small grammar move makes it sound right.
Not: Hang on to the difficult times.
Say: Hang on through the difficult times. / Just hang on in there.
This 'persist' sense is 'hang on (in there)'. 'Hang on TO' means physically grip or keep something.
Which sounds natural?
Tap the one a native speaker would say.
'Hang on (in there)' is the natural, encouraging phrase for enduring. 'Persevere despite adversity' is a motto, not speech.
Build natural chunks
Words that usually travel with it.
hang on (in there)
- in there
- a bit longer
- somehow
- till payday
Don't confuse it
Related
Other meanings and phrases to compare.
- hang on (wait for a short time) — 'hang on' also has the more basic meaning 'wait for a short time'; this is the advanced sense.