Note down the make and model number of your ceiling fan. Then put the make and model number on an internet search, along with the word "manual". The search engine, whatever it is, (I don't use nosy Google), should give you a link to where you can download the manual for your model. Hopefully, the manual will have a pic of the electrical connections and how to properly hook them up.
In fact, you might try going to YouTube and writing in the make and model there. Lots and lots of companies put videos on YouTube to show customers the proper way to use their products, and a lot of handymen and repair people make videos on their own showing people how to do install and repair mechanical and electrical things.
If you get no answers from this board, you might try jotting down the make and model number then registering on a message board that is dedicated to home DIY projects such as this:
The people who answer there are usually pros or hobbyists thoroughly familiar with these issues.