transform.SetPositionAndRotation(0, 0, 0),SetPositionAndRotaion

I am a beginner and need help with this!
transform.SetPositionAndRotation( //what do i put in here! )

Unity’s answer did not make sense!,I am a beginner and I need help with this line of code here (need it for my game!).
transform.SetPositionAndRotation( // do not know what to do in here! )

ok first it’s a short form of those two properties:


transform.position (Vector3, representative for 3d Vectors and Points)

transform.rotation (Quaternion, representative for Rotations in 3d Spaces )


what you can put in transform.SetPositionAndRotation is following for example:


using UnityEngine;
public class ExampleScript : MonoBehaviour {

public Vector3 MyPosition;
public Vector3 MyRotaion;

void Update () {

	transform.SetPositionAndRotation(MyPosition, Quaternion.Euler( MyRotaion ));
	
	// if you want to set it without a public reference do this:

	transform.SetPositionAndRotation(new Vector3(0,0,0), Quaternion.Euler(new Vector3(0,0,0)));

	// below you see how it's implemented for each property

	// transform.position = MyPosition;
	// transform.rotation = Quaternion.Euler(MyRotaion);
		
	}
}

So I looked around and couldn’t find a way to get Transform.SetPositionAndRotation to work so I used
this code instead:

public Vector3 desiredPos;
public Quaternion desiredRot;
// Use this for initialization
void Start () {
	
}

// Update is called once per frame
void Update () {
    if (Input.GetMouseButtonDown(0))
    {
        transform.position = (desiredPos);
        transform.rotation = (desiredRot);
    }	
}

Thank you guys so much!
This is also my first time making my own project in Unity so I needed some help!