Fetch Entries with Tags Only
What you are looking for is the relatedTo parameter (docs) and this post will also help.

If you wanted to return any entries which has (any) tags attached, you could do:

$entries = Entry::find()-&gt;tags(':notempty:')-&gt;all();


Where tags is the handle of your tags field.