The recurrent load shedding crisis in South Africa has highlighted the need to accurately predict electricity consumption for residential buildings. This has significant ramifications for daily life and economic productivity. To address this challenge, this study leverages machine learning models to predict the hourly energy consumption of residential buildings in South Africa. This study evaluates the performance of various regression techniques, including Random Forest (RF), Decision Tree (DT), Extreme Gradient Boosting (XGBoost), and Adaptive Boosting (AdaBoost) machine learning models, using a national residential dataset that contains measurements collected every hour. The objective is to determine the most effective models for predicting next-hour residential building consumption. These models use historical patterns of energy usage to capture temporal details such as seasonal variations and rolling averages. Feature engineering methods are further employed to enhance their predictive capabilities. The performance of each individual model was evaluated using criteria such as the mean squared error (MSE), mean absolute error (MAE), mean absolute percentage error (MAPE), and coefficient of determination (R2). The results show that both RF and DT achieve the best accuracy for the prediction of residential electricity consumption (because the MSE, MAE, and MAPE for RF and DT are very close to 0). These findings offer actionable insights for households, businesses, and policymakers. By enabling more accurate and granular energy consumption forecasts, this can mitigate the effects of load shedding. This study contributes to the discourse on sustainable energy management by combining advanced machine learning models with real-world energy challenges.