The first thing you should do is remove the dust cup and vacuum head.
You will see a plate that is usually held together by a few screws. Remove the screws and twist the wire nuts and tape that are located beneath the screws.
This gives you access to the power cord. Once it has been removed and a new one has been installed, follow the same steps in reverse order to put everything back into their correct positions.