I agree with Chin C. Either way is acceptable. The classic way is to teeth cleaning is to floss first and brush the teeth afterward. Flossing removes the bits of food between the teeth. Once these little pieces of food and plaque are loose, the toothbrush will brush them away.
Either way is acceptable as long as you do a thorough job.
Source: https://www.ada.org/en/member-center/oral-health-topics/floss