Most wall dimmers are listed only for lighting. A ceiling fan is a motor. A light dimmer chops the wave the motor expects, so the fan can hum, run hot, or wear out early. In the worst case the dimmer itself overheats.
Use a fan speed control listed for ceiling fans and rated for that fan's current. If the fan has a light kit, give the fan and the light their own controls: two switched conductors, or the remote that came with the fan. Many DC-motor fans only run properly on the control they shipped with, so read the fan manual before you buy a wall control.
Turn the breaker off before you open a box. If you cannot tell the fan conductor from the light conductor, stop and call a licensed electrician.
Shop lighting controls on eBay