Typing a six digit code from a text message into a web form is annoying, because you have to remember it. A single attribute lets the browser offer to fill it in.
<form action="/verify" method="post">
<label for="otp">Verification code:</label>
<input name="otp" id="otp" type="text"
inputmode="numeric" autocomplete="one-time-code">
<button type="submit">Verify</button>
</form>
MDN describes the one-time-code token as a one-time password used to verify identity as an additional factor when signing in, most often delivered by SMS, email or an authenticator app. The browser can offer the code it received as a suggestion for the field.
MDN adds that browsers may need the input to have a name or id, sit inside a form, and belong to a form that has a submit button. Meeting those conditions makes autofill more likely.
The inputmode="numeric" in the example is not required by the token. It is a common companion that shows a number keypad on phones.
The caveat is what not to do. Do not put autocomplete="off" on these fields out of habit, since that removes something many people rely on. And do not invent your own token values to block autofill, because MDN says that fails WCAG 2.2 success criterion 1.3.5. What the browser actually offers still depends on the browser and device, so test it on the phones your visitors use.
Further reading: MDN: autocomplete attribute