Remove item from cart
You can remove a line item by including a remove parameter in the request. This example adds a checkbox the customer can use to remove the line item from the cart:
{% set cart = craft.commerce.carts.cart %}
&lt;form method=&quot;post&quot;&gt;
    {{ csrfInput() }}
    {{ actionInput('commerce/cart/update-cart') }}
    {% for item in cart.lineItems %}
        &lt;input type=&quot;number&quot; name=&quot;lineItems[{{ item.id }}][qty]&quot; min=&quot;1&quot; value=&quot;{{ item.qty }}&quot;&gt;
        &lt;input type=&quot;text&quot; name=&quot;lineItems[{{ item.id }}][note]&quot; placeholder=&quot;My Note&quot; value=&quot;{{ item.note }}&quot;&gt;
        &lt;input type=&quot;checkbox&quot; name=&quot;lineItems[{{ item.id }}][remove]&quot; value=&quot;1&quot;&gt; Remove item&lt;br&gt;
    {% endfor %}
    &lt;button type=&quot;submit&quot;&gt;Update Line Item&lt;/button&gt;
&lt;/form&gt;

You can check more on this on craft commerce documentation by using below link.
https://craftcms.com/docs/commerce/3.x/orders-carts.html#carts