Some fields store arrays, fields like checkboxes, multi select and others. When you use the_field() for fields that store arrays ACF converts the array to a string and puts a comma between each element. For these types of fields, it you want to format the values in some other way then you need to use get_field() and then loop through the array yourself. These concepts are all covered in the documentation for each type of field that needs special consideration, like checkboxes https://www.advancedcustomfields.com/resources/checkbox/
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!