I hold B and move the d-pad with the pokeball shakes. It is a funny habit I formed when one of my friends in elementary told me this helps catching pokemon. This was when Red and Blue where quite new and well we were children.
For all games before the DS, I hold down the A and B buttons together. Anything after the DS, I use the stylus to circle the pokeball on the bottom screen until it works. They seem to work for some reason.
It depends on what game I'm playing.
RSE: A or Start, A or L/R in time with the shaking,A/Start when it stops. A,A,A,A,A or Start, R,L,R,Start
Diamond onward: A button in time with Pokeball closing, shaking, and sparking.