Artificial Intelligence (AI) techniques have changed the general perceptions about medical diagnostics, especially after the introduction and development of Convolutional Neural Networks (CNN) and advanced Deep Learning (DL) and Machine Learning (ML) approaches. In general, dermatologists visually inspect the images and assess the morphological variables such as borders, colors, and shapes to diagnose the disease. In this background, AI techniques make use of algorithms and computer systems to mimic the cognitive functions of the human brain and assist clinicians and researchers. In recent years, AI has been applied extensively in the domain of dermatology, especially for the detection and classification of skin cancer and other general skin diseases. In this research article, the authors propose an Optimal Multi-Attention Fusion Convolutional Neural Network-based Skin Cancer Diagnosis (MAFCNN-SCD) technique for the detection of skin cancer in dermoscopic images. The primary aim of the proposed MAFCNN-SCD technique is to classify skin cancer on dermoscopic images. In the presented MAFCNN-SCD technique, the data pre-processing is performed at the initial stage. Next, the MAFNet method is applied as a feature extractor with Henry Gas Solubility Optimization (HGSO) algorithm as a hyperparameter optimizer. Finally, the Deep Belief Network (DBN) method is exploited for the detection and classification of skin cancer. A sequence of simulations was conducted to establish the superior performance of the proposed MAFCNN-SCD approach. The comprehensive comparative analysis outcomes confirmed the supreme performance of the proposed MAFCNN-SCD technique over other methodologies.