When someone is getting less concentrated, confused, or committing mistakes all the time then he is losing his marbels. It is related to the mental status of this person. It does not mean he is metally ill though.
I can not pass this exam. It seems I am losing my marbels