Find currently active cart for both logged in and anonymous user

You can get current users order/cart with this 

$orders = \Drupal::entityTypeManager()->getStorage('commerce_order')->loadByProperties(['uid' => $user_id, 'cart' => '0']);

but this would be ok only for logged in users, for anonymous you need to get info from session and to get that, you should use cart_provider service and fetch the first cart from results(that is currently active cart)
 

$cart_provider = \Drupal::service('commerce_cart.cart_provider');
$carts = $cart_provider->getCarts();
$order = array_shift($carts);