Diagnosis
The locking mechanism is worn out. This is usually on the brush head side, not the handle. The little plastic tabs inside the brush head that snap onto the handle's metal shaft get fatigued or break.
How to Fix It
1) The immediate fix is to try a brand new, official Waterpik Sonic-Fusion replacement brush head. Push it on until you feel a definite, firm click. The generic or older model Waterpik brush heads have slightly different tolerances and won't lock as securely. 2) Before attaching the new one, wipe the metal drive shaft on the handle clean and dry to ensure a good grip.
If That Didn't Work
If even a new, official brush head won't stay on, look at the metal drive shaft on the handle. If it's bent, scored, or corroded, it won't hold the head. That's a handle replacement issue.
Heads Up
Don't twist the brush head when putting it on or taking it off. That sideways force is what wears out and breaks the little plastic locking tabs inside the head. Push it straight on and pull it straight off.