You might want to break the function out into two parts, as two serially-called āhelperā functions.
helper function 1 takes a list of tags, such as āRedForcesā and āMonstersā (as a string array) and produces a single array (or list) containing ALL of the game objects that meet the tag criteria.
helper function 2 would accept a list of game objects and then iterate to find whatever you want to find out of them, like the closest, angriest, scariest, etc.
Look into using the List<> generic (gotta put a using System.Collections.Generic at the top of your script to use List<>) because you can grow that list in size (with the .AddRange() method on a List<>), whereas C# arrays are immutable in size once created.
Whatās cool about the above is that if you want to do other things with āFound lists of tagged enemiesā then you have a simple function you donāt have to rewrite.
Also, if you are able to obtain the list of enemies from somewhere else, you could still pass it to the second helper to āfind closest.ā
Read the function header, the Vector3 is the relative position you want it to be closest to, the string tag is for your āRedForcesā or āMonstersā.