how to point the positive Y axis of an object to a direction

I’m trying to figure it out how to point the positive side of a game object to a direction. any help would be appreciated, this is the code that I’m currently using:

//naming the gameobject
GameObject zPathHolder = new GameObject(z > 0 ? "+Z Path Holder" : "-Z Path Holder");
//assigning the parent
//calculating the world positioni of the holder
Vector3 holderPosition = new Vector3(x * 10, y * 10, z * 10 + z * 5f);
//direction from center of the current block to the holder position
Vector3 dir = holderPosition - tempGO.transform.position;
//the rotation of the path holder
Quaternion holderRotation = Quaternion.LookRotation(dir, zPathHolder.transform.right);
//assigning the world position
zPathHolder.transform.position = holderPosition;
//assigning the rotation
zPathHolder.transform.rotation = holderRotation;

but it doesn’t work as expected, how can I fix it?

And you want the positive Y to point where the positive Z is pointing there?

Just switch the parameters around in your LookRotation

Quaternion holderRotation = Quaternion.LookRotation(zPathHolder.transform.right, dir);

The second parameter literally is where the positive Y will point as explained in the manual