There are several ways you can prevent broken fillings, such as:
Brushing and flossing daily
Visiting your dentist for routine checkups
Avoiding sugary and acidic foods
Wearing a mouthguard or night guard
Avoiding biting down too hard