So I'd advise don't waste money on a hub. As the sibling comment points out, port mirroring is a thing.
Through reading and understanding the fundamentals, just like we all had. The concept of port mirroring is super simple, I don’t remember any difficulties with that back then when I was a junior neteng. Nor did I need a hub to learn basics.
Any proper L2/L3 switch has mirroring so using a hub isn't mandatory.
Back in the times of IPX and NetBEUI that was indeed a useful activity - connecting two Windows 3.11 computers with NetBEUI was a nice way to learn Ethernet LLC-2 (yes, the connection-oriented Ethernet layer protocol :-) as it allowed to nicely trigger the DLSW to learn it.
What?? You don’t have to buy a hub to learn networking. Switch with port mirroring works fine; a couple of VMs with packet sniffing on the interfaces work even better. I am not even sure if you still can buy a hub in 2024 - I’ve not seen any since like 2005? This advice is weird.