How to remove the woocommerce_checkout_process action hook in woocommerce if particular project in cart [closed]

try this below code in your function.php file or in your plugin

add_action("init", function () {
    // removing the woocommerce hook
    foreach( WC()->cart->get_cart() as $cart_item ){
            $product_id = $cart_item['product_id'];
            if($product_id!='19')
            {
        remove_action('woocommerce_checkout_process', 'my_custom_checkout_field_process');
    }
}
});