How do I sort GameObjects [] gos ? in C#

C# ANSWER ONLY PLEASE:
How do I sort GameObjects ?
Below is my hack for what I did - but I want to know what are people doing to sort GameObject lists?

//using free plugin multitags Unity Asset Store - The Best Assets for Game Making

public void FindClosestEnemy ()
		{
			if (m_Enemy == null){

				GameObject [] gos = MultiTags.FindGameObjectsWithMultiTag("Entity");	

//I put this next tag sort becasue this is what I wanted
//GameObject myTeamates = MultiTags.FindGameObjectsWithMultiTag(myTag);

//But this is what I did

				List<GameObject> list = new List<GameObject>(gos);
				for (int i = 0; i + 1 < gos.Length; i++) {
					if (gos *.HasTag (myTag)) {*

_ list.Remove(list*);_
_
}_
_
}_
_
gos = list.ToArray();*_

* closestEnemy = null;*
* float distance = Mathf.Infinity;*
* Vector3 position = transform.position;*

* foreach (GameObject go in gos) {*
* if (go == gameObject) continue;*
* Vector3 diff = go.transform.position - position;*
* float curDistance = diff.sqrMagnitude;*

* if (curDistance < distance) {*

* closestEnemy = go;*

* distance = curDistance;*
* }*

* if (closestEnemy.tag ==(“NPC”)) {*
* // m_Enemy = null;
_
// return;_
m_Enemy = closestEnemy.GetComponent ();*

* }*

* if (closestEnemy.tag== (“Player”)) {*
* // m_Enemy = null;
_
// return;_
m_Enemy = closestEnemy.GetComponent ();
_
}*_

* }*

* }*
* }*

The first question to ask is: do you really need to sort the entire array? In a basic case, sorting the whole array requires comparing each element in it to every other element in the array, resulting in running your comparison check array.Length-1 * array.Length-1 times and reading and re-writing elements in the array to their new positions. That’s a lot of operations.

If you just need to find out which item in the array is the “most suitable” one for your purposes, you should keep the code you are using now. This code only has to compare the previously found best option against each remaining array element once, which is an order of magnitude less operations than sorting tye whole array.

If you really need to sort the array, use some overload of Array.Sort for example. So make a function that takes in object A and object B and returns a negative number if A should come first in the array and a positive number if B should come first and use that as the Comparison method in Array.Sort.