The deployment of battery energy storage systems (BESS) can provide numerous benefits including increased renewable energy penetration, improvements in power quality and reliability, reduction of demand peaks, and reduced greenhouse gas (GHG) emissions. During the implementation of BESS, one of the most crucial factors is to determine the optimal size of the BESS to permit the balance between the technical characteristics of the BESS and the additional overall cost including the economic operation of the microgrid (MG). Therefore, the optimal sizing of the BESS allows the storage of sufficient power during the change of dispatch from the distributed energy resources (DERs) or in critical events such as natural disasters. The proposed framework determines the optimal size of the BESS based on forecasting the natural disasters or the outage cases, to enhance the reliability and economic operation of the MG. In this study, two stages are proposed to determine the optimal size of BESS in the MG. The first stage is the forecasting stage, which predicts the location of the outage or the faults that may occur. In the second stage, obtain the optimal size of the BESS to minimize the total operation cost for an economic operation of the MG. The teaching-learning-based optimization (TLBO) combined with quadratic programming (QP) is applied to solve the proposed objective formulation