Lung cancer poses a major global health threat, resulting in significant fatalities. Early identification of lung cancer is essential for successful treatment, making it a crucial area of focus. Computer-aided diagnosis tools can be very helpful in finding stage I lung cancer. Deep learning techniques are now widely applied in many medical fields to improve earlier diagnosis, particularly for different cancer kinds including breast cancer and lung cancer. Our proposed model utilizes convolutional neural networks (CNN) to analyze histopathological images and accurately classify lung cancer as benign or malignant. In this paper, three convolutional neural network (CNN) models 2D CNN, ResNet-50, and VGG19 are used to diagnose lung cancer from histopathological pictures. We have done data preprocessing before training these models, due to which our models give better results than previous works. With VGG19 achieving accuracy, these models provide excellent accuracy and can lower costs while enhancing detection accuracy. This use of deep convolutional neural networks is anticipated to have a substantial influence on both cancer diagnosis and medical research.