I've tried both methods described by lilruffian and had better success with the direct pressure. I have watched the Clinton Anderson videos on this topic and he uses the training staff very effectively. I'm just not very practiced at giving a consistent cue with the staff yet. The fact that I'm not very consistent with the staff makes my horse confused with that method. It takes practice to do right. The direct pressure method is easier for me to do with consistency.
With my current horse, which I bought as a 6 year-old "greenbroke", I have taught her sidepass by using direct pressure on her side in the places I touch my spurs when I'm riding.
To move her rear quarters, I stand at her shoulder, facing her shoulder, hold a loose lead with the hand closer to her head (loose enough that there is no pressure, but tight enough that I can give her a jerk to keep her from walking forward and keep her attention when necessary). With the other hand I press my thumb or knuckle into her side, a bit aft of where the cinch would be, to give the cue (again, simulating where my spur or heel would touch if I were riding). If she doesn't respond to thumb pressure (she didn't at first) I use the handle of the training staff. The first couple of bumps are firm, but light. After that, the bumps become progressively harder until she figures she has to do something to stop this irritating pain in the...side. I keep the bumps coming until she takes one step away from me with her rear, and I look for her to cross her near hoof over in front of the far hoof, then I stop the signal and rub where I was jabbing. Repeat that until she begins to reliably take one step when you give the cue, then progress to two correct steps, then three correct steps, etc. You have to move with her as she steps her rear away from you, or you won't be able to be consistent with the cue.
For moving the fore quarters, I do exactly the same thing, except the pressure point for the cue is in front of where the cinch would be, directly behind the elbow. If necessary, I also take up slack on the halter lead and use that hand to give her a little pressure on the halter to get her to take that first step with her fore quarters without moving forward.
When she reliably moves with a moderately light cue for the front and rear (that might take several sessions), I start working on giving her the cue in the middle for the sidepass (so you need to make sure your rear cue is far enough to the rear that he/she can tell that the sidepass cue is different from the other two). In other words, the sidepass cue goes approximately between the two other cues, about where the cinch would go if a saddle were in place. I found it was easier to get her to learn sidepass from the saddle first, after she learned the fore and rear cues. After that, she seemed to understand the sidepass cue on the ground better.
When I start the work from the saddle, I wear spurs, because I seem to get quicker and more willing compliance when I use them than without. Speeds up the learning process a bit. I will hold her head with the reins and bump her with the spur in the same places I just described above to ask her to do the moves she learned in the ground work. I start with a light bump, but get progressively harder until she figures out that she HAS
to do something. Once she starts trying, I don't increase the bump force any more. Once she takes a step in the right direction I immediately stop spurring and rub her on the neck and talk to her. It didn't take her very long to correlate the cues with the spurs to the movements she learned in the ground training.
Always be satisfied at first with just an effort to do what you want, remove pressure, reward with a rub and voice. Expect progress every few minutes and ask for more as he/she progresses.
Don't forget that you have to teach everything from the beginning on both sides of the horse. The horse doesn't seem to be able to correlate what happens on one side with his other side. Don't expect your horse to understand a cue on the right side, just because you taught it on the left. Their brain doesn't work that way. Also, don't be shy about increasing pressure with the cues. Horses gnash teeth, bite, and kick when they want compliance from another horse. Sometimes you have to make your cue uncomfortable enough that the horse has
to try something to stop it. Once he starts trying, don't increase the pressure, but don't release it until he does the right things.
Sometimes the horse will get frustrated trying to differentiate the cues. Sometimes they get things mixed up and get frustrated when the cues don't stop. Sometimes you just have to stop and go on to something else to clear their mind, then come back to it. Always try to stop training on a good note, though.
By the way, a training halter - a thin rope halter with knots on the nose band - really helps with this stuff. Helps you keep their attention where it should be.