There's three (possibly four) different English constructions that contain the string used to.
One (possibly two) is (possibly are) the simple past participle used /yuzd/ plus the complementizer /to/ for a following purpose infinitive
a) The shovel in the garage is used to dig with.
b) The shovel used to dig with is in the garage.
Note -- both (a) and (b) are pronounced /yuzdtu, yuztu, yuzdtə/, or /yuztə/, with a voiced /z/.
Some might consider (a) and (b) different constructions, but I would consider (b) just a Whiz-deleted relative clause, derived from The shovel (which is) used to dig with... That's what I meant above by "(possibly four)." How one counts depends on what one believes one is counting.
The other two constructions containing have to are both idiomatic, which means, in this case, that
both idioms have special meanings
- one (c) means "accustomed to" and the other (d) means "perfective generic or stative"
- c) I'm not used to typing on this new keyboard yet.
- d) I used to type on a Dvorak keyboard.
both have special grammar
both (c) and (d) have (the same) special pronunciation
- both idioms fuse the string used to into a single word (/yustə/ occasionally /yustu/),
- both idioms always pronounce this with voiceless /s/, never with voiced /z/.
- both idioms disallow (or at least disapprove of) separation of the used and the to
- Occasionally, when the spirit moved him, he used to walk over and buy a beer.
- *He used, occasionally, when the spirit moved him, to walk over and buy a beer.
(If you think you find this last example grammatical, consider whether you're pronouncing "used ... to" as /yus...tə/ or /yuzd ... tə/ or /yust ... tə/. None of these sound write; this is one construction that occurs practically only in writing, and then only for readers who don't hear what they're reading in their mind's ear.)