Both work grammatically. ‘Used to’ gives a bit more sense of ongoing or habitual action in the past. It also implies you don’t do it / have it any more. When I was child I used to eat a lot of sweets, (but now I am grown up I don’t eat so many).
Good explanation here https://www.englishclub.com/grammar/verbs-m_used-to-do.htm