Pneumonia, a prevalent lung infection caused by various pathogens, remains a leading cause of hospitalization globally, particularly in resource-limited regions where expert radiologists are scarce. Chest X-rays (CXRs) are the primary diagnostic tool for pneumonia; however, their manual interpretation is time-consuming and requires significant expertise. This study investigates the potential of deep learning for automated pneumonia detection and localization, addressing challenges of efficiency and accessibility in clinical diagnostics. A Convolutional Neural Network (CNN) was employed for image classification, and the YOLO algorithm was utilized for region-of-interest (ROI) localization. Four models were trained using diverse CXR datasets preprocessed for consistency, incorporating varying combinations of data augmentation and dropout techniques. Model performance was evaluated based on training accuracy, validation accuracy, and F1-scores. The best-performing model achieved a training accuracy of 0.968, a validation accuracy of 0.83, and F1-scores of 0.799 for normal images and 0.819 for pneumonia images. Additionally, the YOLO-based localization approach achieved F1-scores of 0.82 for normal images and 0.54 for pneumonia images, with a weighted average of 0.71 and a macro average of 0.68. This study demonstrates the feasibility of machine learning models for automated pneumonia detection and localization in CXRs, providing a cost-effective and efficient alternative to traditional diagnostic methods. The proposed models significantly reduce diagnostic time while maintaining high accuracy, offering a transformative solution for healthcare systems, particularly in under-resourced settings. These advancements have the potential to alleviate the burden on radiologists, improve patient outcomes, and enhance access to quality healthcare worldwide.