How to set local velocity

Hello, how do I set the z value of the local velocity of an object? Thanks!

EDIT: I am not sure what you are asking. Do you want to add local velocity in the forward direction(z-axis) to a object?

You did not clarify which object(Rigidbody? CharacterController?), but I guess you can use
Transform.TransformDirection();. To get the local coordinates and add velocity accordingly.