Early detection and prediction of cancer, a group of chronic diseases responsible for a large number of deaths each year and a serious public health hazard, can lead to more effective treatment at an earlier stage in the disease's progression. In the current era, machine learning (ML) has widely been used to develop predictive models for incurable diseases such as cancer, heart disease, and diabetes, among others, taking into account both existing datasets and personally collected datasets, more research is still being conducted in this area. Using recursive feature elimination (RFE), principal component analysis (PCA), the Firefly Algorithm (FA), and a support vector machine (SVM) classifier, this study proposed a Firefly Optimizer-enabled Hybrid approach for Cancer classification (FOHC). This study considers feature selection and dimensionality reduction techniques RFE and PCA, and FA is used as the optimization algorithm. In the last stage, the SVM is applied to the pre-processed dataset as the classifier. To evaluate the proposed model, empirical analysis has been carried out on three different kinds of cancer disease datasets including Brain, Breast, and Lung cancer obtained from the UCI-ML warehouse. Based on the various performance parameters like accuracy, error rate, precision, recall, f-measure, etc., some experiments are carried out on the Jupyter platform using Python codes. This proposed model, FOHC, surpasses previous methods and other considered state-of-the-art works, with 98.94% accuracy for Breast cancer, 95.58% accuracy for Lung cancer, and 96.34% accuracy for Brain cancer. The outcomes of these experiments represent the effectiveness of the proposed work.