how do I create an object where I click the mouse

this C# s script doesn’t work even after I fixed the missing {}

The code should work, just add it to a gameobject and assign a prefab to the particle variable and run the game.
If its not working that you can add debug logs to checks if the codes is executed and to find out hat is not working.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    public GameObject particle;
    void Update() {
        if (Input.GetButtonDown("Fire1")) {
            Debug.Log("I clicked");
            Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            if (Physics.Raycast(ray))
                Debug.Log("I hit somting");
                Instantiate(particle, transform.position, transform.rotation) as GameObject;
           
        }
    }
}

fffMalzbier,
Thank you
I get :
Assets/clickOnMe.cs(13,100): error CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement

so I took of “as GameObject” and it worked.