The key, wether you are in the saddle or on the ground, is to teach them to yield to pressure - both front and back end. If you do halter obstacle, you'll want to teach them to sidepass without touching eventually.
1. Start by teaching what I consider to be simple barn manners. Tie your horse and teach them to move their hip over when you touch them and give them a verbal signal. It's natural for a horse to push back on pressure, so this could take some time. Do it from each side.
2. Next, stand at their head and teach them to move their hip away when you touch them with a crop or short whip and speak your verbal command. You'll find teaching them to take a queue from a whip helpful when you are ready to side pass.
3. Teach the horse to move away from pressure at the shoulder. Stand just in front of the shoulder with the lead in your hand. Put pressure on the shoulder, push the lead away slightly and give them a verbal signal (see KayKay's earlier post).
4. Finally, once your horse/pony has mastered all this, combine his new skils to get the whole horse (not just the front or back end) to side pass. I find it helpful if you have them face a wall the first few times. Stand just ahead of their shoulder and signal them with the crop/whip to move their hip away from you while at the same time asking them to move their shoulder away. You want to keep their head straight or slightly turned towards you, so instead of pushing their head away, you will actually hold the lead with just a little tension. The side pass is in many ways similar to a half-pass in dressage. If you've ever seen a dressage horse do a half-pass, you'll notice that the horse is bent slightly AWAY from the directly they are traveling (which would be towards you as the handler).