throw in the towel
To give up or surrender. Probably related in origin to throwing up the white flag, which also indicates surrender.
Example:
When I was losing by 5 in the game of Don't Throw The Towel in the Bucket with a minute remaining, I realized it was hopeless and decided to just throw in the towel.
When I was losing by 5 in the game of Don't Throw The Towel in the Bucket with a minute remaining, I realized it was hopeless and decided to just throw in the towel.