How Do I Move the Player Character on the Z Axis On Button Press?

You must first change its movement mode to flying mode from its movement component then you can use add movement input node to move it up and down.

set an input key from project settings then use its event to add movement input. for example W =1.0 and S= -1.0