How to correctly set move instantly by offset from facing of player?

I tried to see tutorials and some info here but this line that I use when a certain key is pressed:

transform.position = new Vector3(
    transform.position.x,
    transform.position.y,
    transform.position.z  + 1f
);

Just makes the player offset always in some world direction not towards its facing. How do I need to change this code to make no matter which direction player is facing, will move instantly always forward of that facing

Do a transform.localPosition instead.

transform.localPosition += new Vector3(0, 0, 1f);
transform.position += distance * transform.forward;

just put 1f or whatever value you desire in place of the distance

Thanks! that did it, 1st post was still world axis.