The easiest and safest way is to use a multimeter to test for current. The black and blue wires are called hot wires because they hold electrical current.
How To Connect Ceiling Fan Wires With Pictures Wikihow
Two black wires and two white wires from ceiling. Being the main hot wire the primary function of the black wire is to provide current to the fans motor. During installation of the ceiling fan this white wire should be attached to the other neutral wire of the house wiring. Repeat these connections with the two white. Connect the lead wires from the fixture to the black hot wire in the electrical box by twisting a wire connector to the ends of the lead and hot wires. Its essential that you determine which black wire is hot before proceeding. If you have a blue and black wire hanging out from your ceiling you should also have 2 switches on your wall.
The white wire is your neutral wire the copper wire is the grounded wire and the black wire powers the fan. Twist the black wire from the ceiling fan kit together with the black wire from the electrical box and connect the exposed ends with a wire nut. However if you need to rewire a light switch or a plug socket you may occasionally come across two black wires. The white wire of the ceiling fan is the main neutral for both the light fixture and the fan motor. Connect the green wire to your household ground wire copperbare wire. Black means hot white signifies neutral and green indicates ground.
Connect the white wires neutral wires from your fan and ceiling together. Likewise twist all of the white wires together. Connect the black wires together. Lastly connect the blue wires together or the blue wire to the black wire for lights.