Address the cause
Acute spasms in an other wise healthy individual without muscle disease is usually due to acute disturbance in electrolyte balance, usually potassium
Other than manually messaging the muscle, potassium pills, or even better, bananas. Tomatoes also work. Chronic recurrent spasms need further investigation to rule out muscle or neuromuscular disease.