Replace the batteries in the remote. By far the most common cause of failure of a remote to control a ceiling fan is that the batteries have simply lost their charge. The type of batteries to be used depends on the make and model of the remote you purchased. Buy a new set and install them per the manufacturer's instructions. Reprogram the remote to the fan if necessary and test it again to see if this has resolved the problem.
Check the remote's dip switch settings. Most ceiling fan remotes use a series of tiny dip switches that are placed in either an up or down position to communicate with the fan. If one or more of these switches are positioned incorrectly, the remote will cease to function. Typically, whether a dip switch needs to be in an up or down position depends on the make and model of both the remote and the fan. Again, consult the manufacturer's directions to determine the proper positioning of each switch. The fan may have its own set of dip switches that will also need to be configured to achieve successful communication between the remote and the fan. Once you confirm that all the dip switches on the remote and the fan are in the proper position, check the remote again.
Purchase a universal ceiling fan remote and program it to control the fan. Universal ceiling fan remotes are designed specifically for when the remote that came with your ceiling fan stops working. If the new remote effectively controls the fan, simply continue to use the universal remote in place of the non-working one. If the new remote does not control the fan, the problem is much more likely with the fan itself and it will need to be serviced or replaced.