get posts that doesn’t contain a specific tag

You could try the tax_query with the 'NOT IN' operator (untested)

$myposts = get_posts( 
    [
        'tax_query' => [
            [ 
                'taxonomy' => 'post_tag',
                'terms'    => [ 'index' ],
                'field'    => 'slug',
                'operator' => 'NOT IN',
            ]      
        ]
    ]
);

where the taxonomy slug for tags is post_tag.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)