Assets\scripts\NewBehaviourScript2.cs(13,13): error CS1001: Identifier expected

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

public class NewBehaviourScript2 : MonoBehaviour
float timer;
public GameObject coinPrefab;

void Update();
     timer x= Time.deltaTime;

     If("timer" >= 2f)
        timer = 0;
        float x = Random.Range(-30f, 30f);
        Vector3 position = new Vector3(x, 0 ,0);
        Quaternion rotation = new Quaternion();
        Instantiate(coinPrefab, position, rotation);


You have a line: If("timer" >= 2f)

You can’t compare a string with a float. You probably mean:

If(timer >= 2f)