Malke booking time slot block. make a booking reserved. make a event disable. wordpress, woocommerce booking....
//This is the array that will contain all the availabilities
$availabilities = array();
//Create an array that contains the required fields (from_date and to_date are not necessary in some types of availabilities)
$availability = array(
'type' => 'time:range', //Replace time:range with the type you need
'bookable' => 'yes',
'priority' => 10,
'from' => wc_booking_sanitize_time( "01:00" ),
'to' => wc_booking_sanitize_time( "03:00" ),
'from_date' => wc_clean( "2018-10-02" ),
'to_date' => wc_clean( "2018-10-02" )
);
//If you need to add more than one availability, make a loop and push them all into an array
array_push($availabilities, $availability);
add_post_meta( $post_id, '_wc_booking_availability', $availabilities );