There are a few different ways that you can get a variation's stock quantity in WooCommerce.
One way is to use the WC_Product_Variation class. You can use the get_stock_quantity() method to get a variation's stock quantity.
Here is an example:
$variation = new WC_Product_Variation( $variation_id );
$stock_quantity = $variation->get_stock_quantity();
Another way to get a variation's stock quantity is to use the get_post_meta() function.
Here is an example:
$stock_quantity = get_post_meta( $variation_id, '_stock', true );
You can also use the wc_get_product_variation_stock() function.
Here is an example:
$stock_quantity = wc_get_product_variation_stock( $variation_id );