Three attributes, three different jobs.
type says what the data is. Each type has a value sanitisation algorithm and its own checks. email and url flag malformed values as a type mismatch; number keeps value only if it's a valid floating-point number, otherwise it becomes ""; email strips surrounding whitespace. Types such as date, time and color get native pickers. tel and search behave like text: tel has no format check, because phone formats vary. An unknown type falls back to text.
Choose number only for quantities. The standard's test is whether up and down arrows would make sense; for card numbers or postal codes they don't, so use text.
inputmode picks the virtual keyboard, nothing else. Values: none, text, decimal, numeric, tel, email, url, search. It doesn't validate or sanitise. It's how a text field for digits-only identifiers gets a number pad: inputmode="numeric", with pattern="[0-9]*" if you also want validation. Its sibling enterkeyhint labels the Enter key: enter, done, go, next, previous, search, send.
autocomplete tells autofill which value belongs here. It's a token list: an optional section-* group, an optional shipping or billing, then a field name such as name, email, tel, street-address, postal-code, cc-number, username, current-password, new-password or one-time-code. A trailing webauthn asks the browser to offer saved passkeys (WebAuthn credentials) for the field. Exact tokens let autofill fill related fields together and tell sign-in fields from sign-up ones. off marks a value as sensitive or never reused. Without the attribute, a control takes its form's on or off state.