As far as I know, both MAC and IP broadcast addresses are used to send a packet to all hosts that are connected to a local area network. Why would anyone need two addresses to send a broadcast package?
Remember, IPv4 is not the only layer-3 protocol. Traffic on a LAN is delivered by a layer-2 protocol, so layer-2 protocols need a broadcast address to be able to deliver a broadcast to all hosts on a LAN. Layer-2 protocols can carry any number of layer-3 protocols.
An IPv4 host will drop layer-3 traffic delivered to it that is not destined to its IPv4 address, a subscribed IPv4 multicast address, or an IPv4 broadcast address, even if it is delivered via a layer-2 broadcast frame.
IPv4 has two different broadcasts: the limited broadcast (
255.255.255.255), and the network broadcast (highest IPv4 address in the network). The limited broadcast cannot leave the network on which it originated. The network broadcast used to be enabled on network equipment, e.g. routers, by default, but it is now disabled by default. It allows traffic from one network to be sent to a different network's broadcast address, in order to broadcast to all IPv4 hosts on the other network.
IPv6 has done away with broadcast altogether. You must use multicast.
You use it both every time you send an IP broadcast message. For example a broadcast message lets say looking for a DHCP server in network 192.168.0.0/24 the broadcast address would be 192.168.0.255 and by sending it to that address you also need to send it to the FF:FF:FF:FF:FF:FF in order to find all the ip addresses in that range. if you do not already have communication with any of the hosts in the network range.