From Longman Dictionary of Contemporary Englishbe at your wits’ endbe at your wits’ endWORRIEDto be very upset and not know what to do, because you have tried everything possible to solve a problem → wit
Examples from the Corpus
be at your wits’ end• I'm at my wits' end trying to fix this computer.• I don't know what I can do to keep our marriage together -- I'm at my wits' end!• It was two days before the baby was due, and Robert was at his wit's end.