Review the original item:
Ursula clutched her head, trying to remember the correct formula to solve
the statistics problem,
the only thing she could focus on, however, was the stupid fight
she had in the car with her boyfriend Mac.
You wanted to fix it this way:
Ursula clutched her head, trying to remember the correct formula to solve
the statistics problem the only thing she could
focus on, however, was the stupid fight she had in the car with her boyfriend
Mac.
To delete the comma between problem and the would cause an equally bad problem, a fused sentence. A fused sentence occurs when you have two complete sentences joined with no punctuation whatsoever. Ursula clutched her head ... begins the first sentence. The only thing she could focus on, however, was the stupid fight ... starts the second sentence.
The spot between problem and the needs a stronger break than blank space.
You might want to consult the rules for fixing comma splices and fused sentences.