Parkinson's disease presents a significant challenge as it manifests symptoms like freezing of gait, which can have severe consequences for patients. Freezing of gait is the sudden inability to start or maintain movement, resulting in falls, social isolation, and impaired mobility. In recent days, wearable technology has shown promising results in predicting and detecting freezing of gait in Parkinson's patients. In order to detect the freezing of gait, this study investigates the use of wearable sensor data and machine learning. This study has revealed crucial insights into the optimal sensor position, feature extracted, window size, and overlapping percentage for achieving the best performance in FOG detection. These findings are pivotal for advancing the state-of-the-art methodologies in this domain and provide valuable guidance for future research endeavors and practical applications. The Daphnet Freezing of Gait dataset is used in the study, and a variety of machine learning models are used to detect FOG events, including LightGBM, k-nearest neighbors, decision trees, support vector machines, extreme gradient boosting, gradient boosting machine, and multilayer perceptron. The results show that, the Random Forest model had the highest accuracy of 99.43% and precision of 0.97 when using ankle sensor data, 72 features, and 4s window with 10% overlapping percentage. In order to truly assist researchers in developing strong generalized models, further research, a wider variety of data, and freezing of gait events are required.