Be at (one's) wits' end phrase
In this phrase, "wit" is used in the sense of "mental faculties.a"
Having reached a point where you are exhausted, confused, anxious, or irritated and don't know what to do, often after trying every possible way to solve a problem.
I'm at my wits' end trying to persuade my husband not to gamble at cards.
The security guards were at their wits' end trying to stop the demonstrators from entering the building.
be confused about what to do
Being so scared, confused, and astonished that you can't think or do anything.
To be unable to think clearly and correctly
Unsure or confused.
Not able to focus on something or feel confused because of being shocked or surprised
This phrase dates from around 1377.