transform.localPosition not workin

i want to transform my player’s position, but its not workinnnn

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Respawn : MonoBehaviour
{
[SerializeField] private Transform player;

public void Update()
{
    if(Input.GetKeyDown(KeyCode.R)) {
        player.transform.localPosition = new Vector3(0f, 0f, 0f);
    }
}

}

As your player is already a tranform, removing it below should do it.

[SerializeField]
private Transform player;

public void Update()
{
     if(Input.GetKeyDown(KeyCode.R)) {
         player.localPosition = new Vector3(0f, 0f, 0f);
     }
}