Spawn an object and then destroy it

So, i am a beginner at scripting, and i asked this question before but i didn’t found the answer. Instead, the answers made me even more confuse!

Basically, i want to make a object spawn when the player clicks with the mouse (mousefire1), and then, after a specific time that i can change, the object is destroyed. Can someone at least make the script for me? Or give me a tutorial?

Because i hate when someone say “You need to do this” and then start to say things that doesn’t make sense, and then everyone start to to fight and after 3 hours my question is abandoned forever…

Coroutines run alongside your Update code, and they have the handy feature of WaitForSeconds, which I see was in your tags. Here’s some code to get you started:

public GameObject obj;
public float waitTime = 2; //Wait 2 seconds after click to destroy

GameObject reference;

void Start() {
    reference = (GameObject)Instantiate(obj);

void Update() {
    if(Input.GetMouseButtonDown(0)) StartCoroutine(WaitThenDestroy());

IENumerator WaitThenDestroy() {
    yield return new WaitForSeconds(waitTime);

I know how it can be frustrating when you have no idea what some people are talking about, and it only makes you more frustrated.
Let me know if this helps you. If you have any questions, just leave a comment!