Cancer remains a global health challenge, with various types such as lung, breast, and colon cancer posing significant threats. Timely and accurate diagnosis is crucial for effective treatment and improved survival rates. Genetic research offers promising avenues in the fight against cancer, as identifying gene mutations and expression levels enables the development of targeted therapies and a deeper understanding of disease subtypes and progression. This study explores an innovative hybrid approach to enhance cancer diagnosis and classification. By combining Discrete Cosine Transformation (DCT) and Univariate Feature Selection (UFS) methods, the feature selection process is optimized for the dataset. The extracted features are then rigorously tested using established classifiers to assess their effectiveness in cancer classification. The proposed method's performance was evaluated using eight distinct datasets, and metrics such as MF1, K-score, and sensitivity were calculated and compared with various methods in the literature. Empirical evidence demonstrates that the proposed method outperforms others on 5 out of 8 datasets in terms of both accuracy and computational efficiency. The introduced method represents a reliable tool for cancer diagnosis and classification.