VHDL Clock Divider
Purpose
The purpose of a clock divider is to get the clock frequency that you need for the design. Typically, board oscillators will provide a specific frequency into a part pin that may or may not be the frequency that you need for your design. Many designs need multiple different clock frequencies.
With that said, for clocking, you need to consult the documentation for the part family that you are designing for. As an example, Xilinx provides detailed recommendations on how to handle clocking for each of their FPGA part families.
Here's an example for the Xilinx Ultrascale:
https://www.xilinx.com/support/documentation/user_guides/ug572-ultrascale-clocking.pdfWhat Xilinx commonly recommends is that you handle clock dividers with their dedicated primitives which includes PLL's and MMCM's. An MMCM is a superset of PLL, so depending on which part you have and the needs of your design will determine which one to use. If you have plenty of resources available and only a few clock needs, use the MMCM.
Xilinx tools will let you go use the clock wizard in their GUI where you can set up exactly what you want by putting in the input clock frequency, whether it's coming from a single ended pin, differential pins, or global buffer.
You can then set what output frequency you want on each of the available output channels. The wizard will then set the multiplier and dividers for the channels to try to achieve the output frequency that you want and even tell you what the actual frequency will be.
The wizard also lets you turn on some advanced features if desired and will tell you specs like jitter performance. After using the GUI, it will generate some output files that you can use like a core in your design where it's handling all of the complex stuff for you. This is the recommended way of doing a clock divider so that your routing and timing performance doesn't run into any issues.
Others might recommend using some logic to divide a clock, but in my personal opinion, this is not recommended for many reasons that is beyond the scope of my answer. You can go research the problems associated with gating a clock if you want to explore more.
Stick to the recommendation above and you will avoid numerous problems.
Best Practices
1. Read the recommendation in the clocking documenation for your part family.
2. Use the recommended tool wizards provided by the manufacturer of your part.
3. Try to avoid using logic to generate a clock when you have dedicated part primitives available that can be used correctly with the tool wizard.