Put a single finger up a foot in front of your face and focus on it. Bring it slowly right up to your nose and keep focus on it, and your eyes will cross.
I think practicing this is how I learned to do it on demand as a kid.
You could try to bring your finger close to your nose and focus on it, then abruptly move your finger down out of your field of view. Your eyes are now crossed.
I think practicing this is how I learned to do it on demand as a kid.