Used to is commonly applied to either speak of a past habit or a situation we are accustomed to. However, the structure that follows 'used to' will be determined by the intended meaning.
For example: used to + infinitive = past habit. For example: I used to smoke but not now.
Verb to be + used to + gerund = an accustomed situation. For example: I am used to smoking; I smoke a packet a day.
Take a look at the following two sentences. what's the difference in meaning?
"I used to drink green tea."
"I am used to drinking tea."
'I used to ski, but now I snowboard.'