unity – How to teleport a game object to an empty game object?

You’ve added only two lines that are not in the default script template, and neither of them are correct. One of them is illegal and will not compile, the other is simply useless and does nothing related to what you’re aiming to achieve.

If you’ve really studied multiple tutorials and past Q&A threads and worked at this for days, I have to say that research and effort is not in evidence here, and you should very seriously consider putting this project on pause. Go pick up a beginner’s tutorial – even if it’s for a different kind of game than you want to make, and follow all the steps from beginning to end. Then do it again with a different tutorial. Then again with another.

Once you’ve gotten this amount of practice, you’ll be able to write at least two lines of original code that actually compile, and you can consider resuming your current project with your better-developed understanding of how the language and engine work.

A script that does what you describe might look something like this:

// Class names use PascalCase, with an initial capital letter.
public class DeathFloor : MonoBehaviour {

    // Call this method when something enters the death floor's trigger volume.
    // Add a "2D" to the method name and Collider type if your game is 2D.
    // Be sure your player has a collider and dynamic rigidbody of character
    // controller component attached, and your floor's collider has its
    // "Is Trigger" box ticked.
    void OnTriggerEnter(Collider collider) {

        // Better yet, make this a member variable assigned in the inspector,
        // so you don't need to search for it at runtime.
        var spawnPoint = GameObject.Find("RESPAWN");

        if (spawnPoint == null) {
            Debug.LogError("Could not find a spawn point object named 'RESPAWN'");

        // You might want to check whether collider is the player,
        // or some other object to ignore. Here I'll assume only the player
        // can fall into and activate this particular trigger.
        collider.gameObject.transform.position = spawnPoint.transform.position;