'Would' is only good for actions or situations that were repeated many times; 'Used to' is good for any action or situation that continued for a period of time in the past, including repeated actions or situations.
Would VS used to examples?
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: I used to smoke, but I quit last year. Whenever I craved a cigarette, I would chew gum instead.
Can we use would instead of used to?
would for past habits is slightly more formal than used to. It is often used in stories. We don't normally use the negative or question form of would for past habits. Note that we can't usually use would to talk about past states.