If your keyboard uses a PS/2 connector or the older large 5 pin connector turn off the PC first. If your keyboard has a USB connector, it may be safely connected while the PC is powered on.
If your keyboard connector does not match the connector type on the PC, adapters are available for just a few dollars.
PCs with PS/2 connections will usually have two ports. One port is for the mouse and the other is for the keyboard. Look for a small icon near the ports to identify which is which. You may also inspect the motherboard for a label that identifies the port. If all else fails, take a guess and start the PC, if it beeps, won't start or otherwise behaves strangely, then turn it off and switch wires.
That's it! No other configuration or changes are necessary.