Tab focus order will follow the DOM order of elements by default. If your issue is solely related to elements being out of order, you should reorder the DOM so the elements are in the correct order.
Another related tactic is to use the tabindex attribute. A tabindex of -1 (tabindex="-1") will remove an element from the tab order. A tabindex of 0 (tabindex="0") will add an element to the focus order.
It is highly recommended to avoid positive tabindex values and to structure your DOM in the correct order.