In recent years, global warming has led to a significant increase in the occurrence of disastrous conditions. These events always have devastating effects on distribution systems and lead to massive load shedding. Therefore, the structure of distribution systems must have sufficient strength and resilience to deal with these events. Hence, this paper presents a mixed-integer linear programming (MILP) framework for optimal placement of sectionalizing switches and backup distributed generators (DGs) to enhance resilience under emergency conditions. In the proposed model, low priority, medium priority and high priority loads are considered and a demand response (DR) program is also implemented. In order to evaluate the performance of the system during the extreme weather conditions, 15 scenarios have been generated by the fragility function and the outage rate of lines in each scenario has been calculated. The proposed model is implemented on a modified IEEE 33-bus distribution system and is solved in the form of five case studies by the CPLEX solver in GAMS software. The results demonstrate that optimal placement of switches leads to a 14.32% reduction in the amount energy not served (ENS) under emergency conditions. Also, the results illustrate that the optimal placement of DGs along with the possibility of topology change leads to a 57.03% reduction in the amount of ENS. Finally, the results show that applying DR program leads to a 26.7% reduction in load shedding of high priority loads.