Diabetes is a serious condition that can lead to fatal complications and death due to metabolic disorders caused by a lack of insulin production in the body. This study aims to find the best classification performance on diabetes dataset using Extreme Gradient Boosting (XGBoost) method. The dataset used has 768 rows and 9 columns, with target values of 0 and 1. In this study, resampling is applied to overcome data imbalance using SMOTE, and hyperparameter optimization is performed using GridSearchCV and RandomSearchCV. Model evaluation was performed using confusion matrix as well as metrics such as accuracy, precision, recall, and F1-score. The test results show that the use of GridSearchCV and RandomSearchCV for hyperparameter tuning provides good results. The application of data resampling also managed to improve the overall model performance, especially in the XGBoost method that has been optimized using GridSearchCV, which achieved the highest accuracy of 85%, while XGBoost with RandomSearchCV optimization showed 83% accuracy performance.