The structure used to + infinitive is used to talk about past habits, jobs, or hobbies we no longer practice or which we replaced with the new ones
I used to play a lot of football when I was younger; now I go to the gym.
They used to be good friends, but now they hardly ever meet.
My grandpa used to be a mayor before he retired.
The negative form of used to is didn’t use to.
I didn’t use to drink coffee, but now I do.
My hometown didn’t use to be so polluted, but it is now.
The interrogative form is: Did you use to…?
Did you use to collect stamps when you were younger?
Did they use to walk every evening while on holiday?
Did you use to get up early when you were younger?
The structure used to + infinitive cannot be used to say frequency or duration.
I used to visit Rome many times. I used to live in this neighbourhood for 10 years.