Cannot declare function twice [closed]

I agree with Pat in the comments: the easiest thing to do would be to rename the function in one of the two snippets, changing the name both on the function definition and the add_filter line. But if you did want to combine the two into a single snippet you could do something like this:

function businessbloomer_hide_free_shipping_for_shipping_class( $rates, $package ) {
    $deluxe_tables_shipping_class_target="1173";
    $stag_and_doe_shipping_class_target="1750";

    $hide_local_pickup = false;
    $hide_delivery_shipping = false;

    foreach ( WC()->cart->get_cart_contents() as $key => $values ) {
        $shipping_class_id = $values[ 'data' ]->get_shipping_class_id();
        if ( $deluxe_tables_shipping_class_target == $shipping_class_id ) {
            $hide_local_pickup = true;
        } elseif ( $stag_and_doe_shipping_class_target == $shipping_class_id ) {
            $hide_delivery_shipping = true;
        }
    }
    if ( $hide_local_pickup ) {
        // This is Local Pick up shipping method with ID
        unset( $rates['local_pickup:45'] );
    }
    if ( $hide_delivery_shipping ) {
        // This is Delivery shipping method with ID
        unset( $rates['WB_Custom_WooCommerce_Shipping_Method52'] );
    }
    return $rates;
}
add_filter( 'woocommerce_package_rates',
            'businessbloomer_hide_free_shipping_for_shipping_class', 10, 2 );

(You could also change the code to use === in the two == $shipping_class_id lines but I don’t know if WooCommerce stores that ID as a string or a number, so == is safer.)