For both wrists and ankles, it's pressure placed on the joint that causes it to either-hyper contract or hyper-extend. The reason a wrist breaks often when punching is because a fully extended wrist, when hitting something, causes most of the force to be directed in the same direction as the extending force. A contracted wrist that is extending during a punch directs most of the force straight into the joint, rather than lopsidedly into one side or the other.
Similar thing with an ankle. Ankles are fairly sturdy considering their positions, but they get wrecked by forces that extend or contract the joint beyond their normal position, then quickly resist the foot's momentum while the leg keeps the momentum. Hence why you can have a heavy ghosted kick and not get any ankle dismembers so long as the ankle was fairly rigid during the kick. However, a relaxed ankle that gets hyper extended because of it, then connects with a relatively sturdy part like the chest-area or sometimes the neck, will basically keep all the forward momentum going in the top parts of the ankle, but the foot has been abruptly stopped, causing the break.
Basically, keep the joint in question in as normal a range as possible, and contract or extend appropriately to counter-act any forces that might force it out of that range.