Use Linq. Not the fastest, but quick and easy…

using System.Linq;
List<NodePos> sortedNodes = nodes.OrderBy(o => o.distance).ToList();