'out of stock' products always came after 'in stock' products

Hi!
If i want sorting “out of stock” WooCommerce products be latest, always came after “in stock” products. What do I need to add? If in Bricks there is no function, what custom code can I add?
And so that it does not depend on the type of sortings, orders, filters, “out of stock” always came after “in stock”.
I don’t want hide out of stock product. I want the product be visible, but in the end.

I didn’t find such a function in Bricks builder and decided to change the topic from ‘How To’ to ‘Feature Requests’.
How can I change topic? It would be nice to have such a function.

Found code for this:

<?php

/**
* Sorting out of stock WooCommerce products - Order product collections by stock status, in-stock products first.
*/

class iWC_Orderby_Stock_Status
{
public function __construct()
{
// Check if WooCommerce is active
if (in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))) {
add_filter('posts_clauses', array($this, 'order_by_stock_status'), 2000);
}
}
public function order_by_stock_status($posts_clauses)
{
global $wpdb;
// only change query on WooCommerce loops
if (is_woocommerce() && (is_shop() || is_product_category() || is_product_tag())) {
$posts_clauses['join'] .= " INNER JOIN $wpdb->postmeta istockstatus ON ($wpdb->posts.ID = istockstatus.post_id) ";
$posts_clauses['orderby'] = " istockstatus.meta_value ASC, " . $posts_clauses['orderby'];
$posts_clauses['where'] = " AND istockstatus.meta_key = '_stock_status' AND istockstatus.meta_value <> '' " . $posts_clauses['where'];
}
return $posts_clauses;
}
}
new iWC_Orderby_Stock_Status;
/**
* END - Order product collections by stock status, instock products first.
*/