This research paper presents a novel approach using a Convolutional Neural Network (CNN) to accurately identify skin cancer based on prompts. The technique utilises a dataset acquired from the ISIC Archive, comprising of 1800 photographs of benign moles and 1497 pictures of malignant moles. The study aims to improve the automated classification of skin cancer by employing a deep learning model, recognising the critical significance of visual diagnostics in the detection of skin cancer. The 14-step approach involves essential steps such as importing data, labelling categories, normalising data, and constructing a model using Keras with TensorFlow backend access. The dataset's balanced design facilitates precise evaluation, leading to an exceptional accuracy and precision score of 92.7%. The study underscores the importance of early detection of skin cancer, stressing the practical use of the developed approach. In addition, the implementation of the ResNet50 architecture is examined, which significantly improves the performance of the model. The use of Convolutional Neural Networks (CNNs) in visually discerning skin lesions demonstrates their efficacy and underscores the potential for automated solutions to aid in expeditious and accurate identification of skin cancer.