Pneumonia, a prevalent inflammatory condition affecting lung tissue, poses a significant health threat across all age groups and remains a leading cause of infectious mortality among children worldwide. Early diagnosis is critical in preventing severe complications and potential fatality. Chest X-rays are a valuable diagnostic tool for pneumonia; however, their interpretation can be challenging due to unclear images, overlapping diagnoses, and various abnormalities. Consequently, expedient, and accurate analysis of medical images using computer-aided methods has become crucial. This research proposes a Convolutional Neural Network (CNN) model, specifically the ResNet-RS Model, to automate pneumonia identification. The Contrast Limited Adaptive Histogram Equalization (CLAHE) technique enhances image contrast and highlights abnormalities in pneumonia images. Additionally, data augmentation techniques are applied to expand the image dataset while preserving the intrinsic characteristics of the original images. The proposed methodology is evaluated through three testing scenarios, employing chest X-ray images and pneumonia dataset. The third testing scenario, which incorporates the ResNet-RS model, CLAHE preprocessing, and data augmentation, achieves superior performance among these scenarios. The results show an accuracy of 92% and a training loss of 0.0526. Moreover, this approach effectively mitigates overfitting, a common challenge in deep learning models. By leveraging the power of the ResNet-RS model, along with CLAHE preprocessing and data augmentation techniques, this research demonstrates a promising methodology for accurately detecting pneumonia in chest X-ray images. Such advancements contribute to the early diagnosis and timely treatment of pneumonia, ultimately improving patient outcomes and reducing mortality rates.