New pump or impeller kit

The water will not drain out of the dishwasher. How can I tell if I need a new pump or just the impeller kit?

If the unit washes OK then you do not need either as wash and drain use the same pump.
Is this what is happening?

Here is the parts breakdown.
Replacement parts for GSD4500 models | AppliancePartsPros.com

What could it be then, we checked the drain hose and it is clear and it does wash fine.

I am assuming that this unit used to work OK and that it is not a new install or that any of the plumbing has been changed.

Take a look at the pump in Section 3.

You will see a solenoid mounted on the front left hand side (Item 497).
This is the wash/drain solenoid, it runs a flapper valve in the pump housing.

Does it pull down when the unit is supposed to be draining?
If yes then you may have a plug in the drain system.
Remove the drain at the house plumbing end and check that it is clear.
This is a common spot for stuff to collect and cause a plug.
If it is OK then you will have to work your way back through the system.

Does the unit not drain at all or does it partially drain.
If partially draining the problem may be the piston and nut.
If it does not seal correctly then some of the water is directed back into the tub instead of out the drain.

For the solenoid, up is wash, down is drain.
Try pushing the solenoid arm down to see if it will go to the drain position.
If not then the solenoid may have overheated and melted the plastic inside the solenoid Often the solenoid and the timer have to be replaced as the timer powered the solenoid for too long causing it to overheat.

The way it works is that when the unit is supposed to drain, the timer sends power to the solenoid for a couple seconds, pulling the solenoid piston down. The flapper valve moves to the drain position and the water pressure keeps it there until the unit is empty.

Since you are working on the unit you may as well check the sump for debris.
Remove the sump cover (item 506 in Section 2)
Take note of how the unside piece is installed. If you put it back wrong the chopper will eat it.
Check and remove any debris in the sump aalso check that nothing is wrapped around the chopper.
Be careful when doing this as there is often glass in the sump.