We use USED TO + INFINITIVE when referring to a past habit or action that we no longer do.
We use BE USED TO NOUN/GERUND to express that we are accustomed to something.
be used to can be followed by a noun. When it is followed by an action (verb) the verb must be in the gerund (verb+ing) because it’s following a preposition.