(at one’s) wit`s end

To not know what to do.

I was at my wit`s end trying to decide what to wear to the party.