There are two main methods- one is based on timing and uses software or a low-pass filter and a Schmitt trigger. The principle is that the bounce will only last a bounded amount of time, perhaps 10ms-20ms for a small relay, so by ignoring transitions after the relay has started to change state for a certain amount of time you can get a clean (albeit perhaps slightly delayed, depending on the exact method) signal.
The second method, more rarely used, uses the normally-open and normally-closed contacts to set and reset an RS latch (for example, two cross-coupled NAND or NOR gates). This works because the relay does not bounce between the two states, rather one contact bounces then the other. This is not used so much because it's a bit more complex.
If you are intending to monitor a power relay it's important to observe both the minimum voltage and current specifications in order to get reliable contact detection.
All the above considerations are the same as you would follow debouncing a toggle switch or tact switch, however the relay contacts may not be as forgiving of inadequate current/voltage as most small switches.