The problem
Your computer wants to send a packet to 192.168.1.30 on the same local network. Ethernet delivers frames by MAC address, a fixed hardware address on each network card. Your computer knows the IP, not the MAC.
First it checks its ARP cache: a short list of IP-to-MAC pairs it learned recently. There is a row for 192.168.1.40, but none for 192.168.1.30, so it has to ask.
Ask everyone
It sends an ARP request: "Who has 192.168.1.30? Tell 192.168.1.20." The frame goes to ff:ff:ff:ff:ff:ff, the broadcast address meaning "everyone on this network", and its type field 0x0806 marks it as ARP.
A switch sends a broadcast frame out of every port except the one it came in on. So all three other computers get the same question.
Hosts 192.168.1.40 and 192.168.1.50 read the question. The IP it asks for is not theirs, so they stay quiet and send no reply.
Answer and deliver
192.168.1.30 sees its own IP in the question. Before answering, it saves your pair from the request, 192.168.1.20 → 00:00:5e:00:53:20, in its own ARP cache, so it can reply without asking.
It sends an ARP reply: "192.168.1.30 is at 00:00:5e:00:53:30." This is unicast, addressed only to your MAC. The switch learned your port from the request, so only you receive it.
Your computer writes 192.168.1.30 → 00:00:5e:00:53:30 into its ARP cache. Entries expire after a while, usually minutes; the exact time depends on the operating system.
Now the waiting packet leaves in an Ethernet frame addressed to 00:00:5e:00:53:30, type 0x0800 for IPv4. Next time, the cache answers at once and no question is needed.
The frame, field by field
;; step 1/9 · need-mac ;; at You .20 packet waiting: IPv4 192.168.1.20 → 192.168.1.30 same subnet (192.168.1.0/24), so deliver it directly on the LAN Ethernet frame needs: dst MAC = ?
Gratuitous ARP: a host can announce its own pair unasked, with its own IP as the target, for example after it starts up or takes over an address. Others update their caches (and may spot an address conflict). Checking for a conflict before using an address is the ARP Probe of RFC 5227. ARP has no authentication: any host can send a reply claiming any IP, and others will believe it. That is ARP spoofing, used to sit in the middle of a conversation; switches defend with features such as Dynamic ARP Inspection.