throw in the towel
To abandon a struggle or admit defeat when a situation becomes too difficult to handle or success seems impossible. It implies a conscious decision to stop trying after a period of effort.
مثال
After months of trying, he finally threw in the towel.