Well, this depends on exactly what you are trying to do.
I use a lot of SEW servo drives, and each has to be setup for a homing sequence.
There are six homing sequences to choose from built into the drive, and I use different ones for different applications.
What you need for homing is firstly a home position, a sensor for that home position and a method for always getting to that home position no matter the starting point. This is usually done by having overtravel sensors. Your drive will start moving in one direction first, if it hits the overtravel, then it changes direction until it gets home. A popular scheme is to use one of the over travel sensors as the home position.
After that, if necessary, you can work on methods for gaining precision. This can be by using a relatively moderate speed to find the home sensor, then switch to a low speed to find the exact home position. SEW also use homing off the zero paulse of the encoder to give extra precision. Others I have seen use sensors with a high repeatability.
Pneumatics are generally easy, since they usually can only be in one of two positions.