The idea of giving up initially sounds like a bad thing. However, not all battles need to be won.
When a situation gets out of hand, and things are more difficult or time-consuming than expected, it isn’t always worth powering through. Sustaining good habits is usually more important, and having a healthy meal or a good sleep can make the workload easier later.
In some cases, giving up allows you to change your mindset before approaching the situation again next time. This antifragile behaviour can allow previously impossible feats to become trivial.