UX design focuses on the user flow and how easy it is for the user to accomplish a desired goal. For this reason, whenever I create a UI, I take into account three things: heuristic thinking, choice modelling and compromise effect.
Let’s take the Gmail and Amazon sign-in pages as an example to show you how these concepts might apply to real-life. The tab order is important when you navigate a form with the keyboard. Users should be able to tab through the elements in a logical order. Below we have two different sign-in pages and user experiences:

Amazon implements the UI correctly by following these three principles:
Heuristic thinking:
Allow users to solve problems and make judgments quickly.
Choice modelling:
Assign a value to each form element based on probability (logical order).
Compromise effect:
Avoid users selecting an extreme choice. In this case “Forgot email?”.
It’s worth mentioning that using tabindex values greater than zero to control the tab order is considered a bad idea. The tabindex attribute is often set by developers who don’t have any idea of what the user expects. The tab order should follow a pattern that is logical from the user’s perspective.
More info: