The building sector, known for its high energy consumption, needs to reduce its energy use due to rising greenhouse gas emissions. To attain this goal, a projection for domestic energy usage is needed. This work optimizes short-term load forecasting (STLF) in the building sector while considering several variables (energy consumption/generation, weather information, etc.) that impact energy use. It performs a comparative analysis of various machine learning (ML) models based on different data resolutions and time steps ahead (15 min, 30 min, and 1 h with 4-step-, 2-step-, and 1-step-ahead, respectively) to identify the most accurate prediction method. Performance assessment showed that models like histogram gradient-boosting regression (HGBR), light gradient-boosting machine regression (LGBMR), extra trees regression (ETR), ridge regression (RR), Bayesian ridge regression (BRR), and categorical boosting regression (CBR) outperformed others, each for a specific resolution. Model performance was reported using R2, root mean square error (RMSE), coefficient of variation of RMSE (CVRMSE), normalized RMSE (NRMSE), mean absolute error (MAE), and execution time. The best overall model performance indicated that the resampled 1 h 1-step-ahead prediction was more accurate than the 15 min 4-step-ahead and the 30 min 2-step-ahead predictions. Findings reveal that data preparation is vital for the accuracy of prediction models and should be model-adjusted.