Was expecting to find just 3 simple wires (b, w, g) and be able to hook up this ceiling fan quite easily but found this when taking out the old fan...3 sets of wires, #1 with 2 black and 1 white, #2 with 2 white, and #3 with 1 black. How would I go about wiring this to the new ceiling fan? Thanks!
The 2 black + 1 white is your always-hot bundle. You won't use it (unless you want to power the fan 24x7 and use a remote on it).
The 2 white is the neutral bundle. Your fan will need that.
The loose black is the switched-hot from the switch. (it is the partner wire to the oddball white from above). This is the switched-hot for the fan.
The switch is a switch loop, meaning power comes to the fan (and also goes onward to serve other things)... and the switch merely gets always-hot and switched-hot. It was legal to wire switches that way as recently as 2011. The white could be a real source of confusion, since it's not a neutral, so two special rules apply: #1 the always-hot wire must be white (to make it more obvious that it's not a neutral to people probing it with voltage testers), and #2 the white wire must be marked with black tape or paint to indicate it's a hot.
Without that marking, which was overlooked in your box, it is impossible to distinguish a switch loop from other wires. So it is most important you don't allow the 2 black + 1 white to become separated/confused. It is common for important information like this to only exist in wire position. This is why I own 10 colors of tape.