Skin cancer is the most common form of cancer. Hence, the lives of millions of people are affected by this cancer every year. Approximately, it is predicted that the total number of cases of cancer will double in the next fifty years. It is an expensive procedure to discover skin cancer types in the early stages. Additionally, the survival rate reduces as cancer progresses. The current study proposes an aseptic approach toward skin lesion detection, classification, and segmentation using deep learning and a meta-heuristic optimizer called Harris Hawks Optimization Algorithm (HHO). The current study utilized the manual and automatic segmentation approaches. The manual segmentation is used when the dataset has no masks to use while the automatic segmentation approach is used, using U-Net models, to build an adaptive segmentation model. Additionally, the meta-heuristic HHO optimizer is utilized to achieve the optimization of the hyperparameters using 5 pre-trained CNN models (i.e., VGG16, VGG19, DenseNet169, DenseNet201, and MobileNet). Two are collected (i.e., "Melanoma Skin Cancer Dataset of 10000 Images" and "Skin Cancer ISIC" dataset) from two publically available sources. For the segmentation, the best-reported scores are 0.15908, 91.95%, 0.08864, 0.04313, 0.02072, 0.20767 in terms of loss, accuracy, Mean Absolute Error, Mean Squared Error, Mean Squared Logarithmic Error, and Root Mean Squared Error, respectively. For the "Melanoma Skin Cancer Dataset of 10000 Images" dataset, from the applied experiments, the best reported overall accuracy is 97.08% by the DenseNet169 pre-trained model. For the "Skin Cancer ISIC" dataset, the best reported overall accuracy is 96.06% by the MobileNet pre-trained model. After computing the results, the suggested approach is compared with 9 related studies.