How to Get Position of a Post from a category and tag

Well,

I fixed my own problem. If someone needs it in the future, you can use the code below:

$query = new WP_Query( array(
    'cat' => '22', 
    'posts_per_page' => -1, 
    'orderby' => 'meta_value',
    'meta_key' => 'meta_key_here',
    'order' => 'DESC',
    'fields' => 'ids'
));

global $post;

$i = array_search( $post->ID, $query->posts ) + 1; 

echo '<div class="ranks">';
echo '<a href="https://wordpress.stackexchange.com/...">Post Ranking: </a>'; 
echo "{$i}"; 
echo '</div>';

for tag:

$query = new WP_Query( array(
        'tag_id' => '22', 
        'posts_per_page' => -1, 
        'orderby' => 'meta_value',
        'meta_key' => 'meta_key_here',
        'order' => 'DESC',
        'fields' => 'ids'
    ));

    global $post;

    $i = array_search( $post->ID, $query->posts ) + 1; 

    echo '<div class="ranks">';
    echo '<a href="https://wordpress.stackexchange.com/...">Post Ranking: </a>'; 
    echo "{$i}"; 
    echo '</div>';