Tricks for unlocking my jaw and keeping it from getting locked?

See a dentist. You should see a dentist who is experienced and knowledgeable in the treatment of temporomandibular dysfunctions for an evaluation. Short of that, don't eat hard foods, limit yawns, don't scream, don't chew gum, and again see a dentist to evaluate your teeth, possible bruxism, malocclusions, etc.