Cast a Spell has traits that depend on the spell cast. Specifically, if the spell has any of Material, Somatic or Focus, then it has manipulate (CRB page 302).
If the spell is purely verbal, it may not.
Anyone can - with a free hand or a grapple weapon* - grapple a target no more than one size larger than them. On a success, the target has to make a flat DC 5 check to succeed at any manipulate action - including most spells. On a critical success, the target is restrained and cannot make actions with the manipulate trait - except specific actions to try and escape.
You could also ready the grapple attempt - with the trigger of them casting a spell, you might do this in order to waste some of the target's actions should you succeed - if you grapple on your turn, they might choose not to cast, and instead try to break free, or choose a spell without the manipulate trait. Where as if you readied the action, it has the same chance of interfering with their spell casting, but the don't know not to potentially waste actions casting before trying to break free.
However, note that readying an action instead of taking it on your turn does not allow you to avoid multiple attack penalties - which means that if readying your action to grapple you may want to find something to do with your third action other than attack.
If you are trained in Athletics, you could instead ready an action to Disarm the target - attempting to remove a necessary object for the spell casting from their hands, which on a critical success would prevent a spell that requires material or focus components.
If you have Attack of Opportunity One of Attack of Opportunity's triggers are actions with the Manipulate trait, and it disrupts the triggering manipulate actions on a critical hit.
See Ifusaso's post for other similar acquirable abilities.
*I believe the only grapple weapons in the CRB are from shape shifting - but others could be printed.