How can I fix this?

using UnityEngine;
using System.Collections;

public class Respawn : MonoBehaviour {

	Vector3 respawn_Pos;

	void Start () {
		respawn_Pos = transform.position;
	}

	void Update () {
		if (Input.GetKeyDown (KeyCode.R))
			transform.position = respawn_Pos;
	}

When I enter this code it says “} expected” where I have the “}”.

You forgot { after if (Input.GetKeyDown (KeyCode.R)) and { for the update and the whole class so…

using UnityEngine;
using System.Collections;
 
 public class Respawn : MonoBehaviour {
 
     Vector3 respawn_Pos;
 
     void Start () {
         respawn_Pos = transform.position;
     }
 
     void Update () {
         if (Input.GetKeyDown (KeyCode.R)){
             transform.position = respawn_Pos;
         }
     }
}