A positive tabindex value (like tabindex=5) forces an element to the front of the tab order ahead of everything else on the page, which almost always creates a confusing, unpredictable experience and is considered an anti-pattern by accessibility specialists. The two safe, commonly recommended values are 0, which adds a custom element like a div-based button into the natural document-order tab sequence, and -1, which allows an element to be focused programmatically (for example, moving focus into a newly opened dialog) without adding it to the Tab key sequence.
Native interactive elements like button and a with an href are already keyboard-focusable and do not need a tabindex at all.