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.