Contacting a prospective advisor before applying is not mandatory, but it is strongly recommended.
If you have identified a research area or laboratory that matches your interests, you may contact the relevant faculty member in advance to discuss your research interests and potential opportunities.
However, prior communication with a faculty member does not guarantee admission.