The wording here is purposefully confusing. While a packet technically refers to layer 3, it is a common misnomer for "data transmitted on a network." It is uncommon to hear someone say a frame was transmitted, simply saying packet is much more common. A switch will receive a frame with a packet inside it and transmit the frame based on the MAC address in the frame header.
A network switch (also called switching hub, bridging hub, and by the IEEE MAC bridge) is networking hardware that connects devices on a computer network by using packet switching to receive and forward data to the destination device A network switch is a multiport network bridge that uses MAC addresses to forward data at the data link layer (layer 2) of the OSI model Some switches can also forward data at the network layer (layer 3) by additionally incorporating routing functionality Such switches are commonly known as layer-3 switches or multilayer switchesSwitches for Ethernet are the most common form of network switch