To lose hope / To give up hope
Natural collocation for losing hope. The opposite is mantener la esperanza or no perder la esperanza.
Don't lose hope, there's still a solution.
After months without news, she started to lose hope.
—Do you think it'll work out? —I haven't lost hope.