When a Case is changed to Escalated status using a custom Is_Escalated__c checkbox, require ContactId. Add the checkbox field to the schema. Non-escalated cases do not need a contact for this rule.
Keep the trigger bulk-safe. Do not run SOQL or DML inside loops.