In 'After failing twice, he decided to throw in the towel', the idiom means to:
Explanation
'To throw in the towel' means to give up or quit; the literal 'towel' option is a trap.
Reference: English Vocabulary: Idioms & Phrases (Complete Notes)
, Page 8
Hint
Surrender, don't wash a towel.