Used to and would are both use to describe something that happened regularly in the past but doesn't happen any longer, as shown in the following two sentences about quitting smoking:
However, there are two important differences between used to and would. The first difference is that would should not be used unless it has already been established that the time frame is in the past, while used to does not require this. This example, with used to at the beginning, sounds natural:
However, when used to is replaced with would, the same example becomes awkward and ungrammatical:
But if the past time frame is established before would appears, would sounds fine.
The second difference between used to and would is that would is not used with stative verbs such as love, be, understand, and feel. Compare these two sentences with the stative verb love:
To summarize, the use of would is more restricted than that of used to. Therefore, if you aren't sure which one to use, it's best to choose used to.