This phrase is used to express strong emotions, like panic or anger, in a hyperbolic way. I'm going to have a cow if I can't find my passport before the flight!
Pro Tip 2/3
Informal Speech
Used mainly in casual conversation, not suitable for formal contexts. Just relax, don't have a cow over this little issue.
Pro Tip 3/3
American Slang
Popular in the United States; English speakers from other regions might be unfamiliar with it. My American friend told me not to have a cow when I got stressed.