COVID-19, a global pandemic, has precipitated millions of fatalities worldwide. Concurrently, pneumonia, another perilous disease, continues to affect a vast global population. Diagnosis of COVID-19 can potentially be expedited through image processing techniques applied to chest X-ray (CXR) images. Innovative methodologies such as deep learning and computer vision offer a revolutionary approach to image recognition with minimal human input. This study aims to employ deep learning, specifically convolutional neural networks (CNN), for the detection of COVID-19 and pneumonia. The dataset under scrutiny comprises 9,208 CXR images, distributed across three distinct classes: 3,207 normal (35%), 1,281 COVID-19 (14%), and 4,657 pneumonia (51%). This dataset was subdivided into training and validation data, with an 80% allocation for training and 20% for validation. The approach adopted involved pre-training modifications before validation through data testing. Eight pre-trained models were comparatively analyzed: MobileNet V3 Small, VGG 19, EfficientNet V2 B0, VGG 16, EfficientNet V2 B3, ResNet RS152, EfficientNet V2 Small, and Inception V3. The MobileNet V3 Small model exhibited superior performance, achieving an accuracy of 0.9815.