The basic purpose of a layer 2 switch is:
To break up collision domains.
Layer 2 switches operate at the data link layer of the OSI model and are designed to forward traffic based on MAC addresses. They can create separate collision domains for each connected device, which helps reduce traffic collisions and improve network efficiency. However, they do not break up broadcast domains; that function is typically handled by routers or layer 3 switches.