What you need is a sorting algorithm.
There are quite a few, and it would be difficult to suggest only one.
Dijkstra (spelling?) (that's a person's name) specializes in sorting algorithms, and teaches how to implement the various algorithms, but to say that one is better than another would be doing you an injustice, because each one has it's strong points and it's weak points.
The EASIEST (and SLOWST) is called the "bubble sort", in which you compare each element to every other element, "bubbling" the 1st element to the top of the array, then the 2nd element, the 3rd, etc.
It would look something like this:
FOR i=1 to LastElement-1
... FOR j=i+1 to LastElement
... ... If Array(i) > Array(j) then
... ... ... Temp = Array(i)
... ... ... Array(i) = Array(j)
... ... ... Array(j) = Temp
... ... End If
... Next j
Next i
The stuff in the IF-THEN statement switches the two elements, so each element bubbles up to the top of the list.
Like I said, this is the easiest to understand, but it's also the very slowest.