Problems, goals, and tasks are sorted based on priority. If multiple items have the same priority, those items are displayed according to the assigned sort order. So if two goals both have a high priority, the goal with the highest sort order appears before the other in the care plan.
For existing orgs, you must add the Sort Order field to the Tasks page layout before the field is available to care coordinators or others who create tasks. The field set for Problems and Goals is automatically upgraded.