destroy a trail made by invoke repeat ?

i made a trail that spawns when an object is shot , but i cant seem to make it “destroy” , basically like angry birds , when u shoot the first chicken it draws a trail , you shoot the second one , it draws another trail and destroys the previous one , any idea how to achieve such a result ? here a code snippet

 public GameObject[] trails;
  void OnMouseDown()
    {
        IsPressed = true;
        rb.isKinematic = true;
    }

    void OnMouseUp()
    {
        IsPressed = false;
        rb.isKinematic = false;
        StartCoroutine(Release());
        InvokeRepeating("spawntrail", 0.05f, 0.05f);
    }

   void OnCollisionEnter2D(Collision2D collision)
    {    
        CancelInvoke("spawntrail");       
    }

void spawntrail()
    {
        if (GetComponent<Rigidbody2D>().velocity.sqrMagnitude > 10)
        {
            Instantiate(trails[next], transform.position, Quaternion.identity);
            next = (next + 1) % trails.Length;
        }
    }

by creating clones of the trails and instantiating the clones instead — we are able to destroy the clones. this has been tested with your code and it works.

void spawntrail()
{
    if (GetComponent<Rigidbody2D>().velocity.sqrMagnitude > 10)
     {

          // create clones instead so we can destroy them 

         GameObject clone = Instantiate(trails[next], transform.position, Quaternion.identity);
         next = (next + 1) % trails.Length;
         Destroy(clone, 10F);
       
  }
}