The main function of flagella in bacteria is they enable the bacteria to move.
The flagellar movement provides locomotion to the bacterial cell.
Bacteria can have one or several flagella. There are basically four different types of flagellar arrangements. (singular flagellum, plural flagella)
Monotrichous: a single flagellum can extend from one end of the cell
Amphitrichous: a single flagellum or multiple flagella extend on both ends of the bacterial cell
Lophotrichous: numerous flagella can extend from one end or both ends of the bacterial cell
Peritrichous: multiple flagella are distributed all over the bacterial cell