Employing MATLAB/Simulink, this study designs and builds a fault-detecting and locating approaches for underground distribution and transmission networks. The suggested approach detects and locates faults through an AI-based waveform shift, which has become an established technique in electric power system investigations. MATLAB/Simulink 2019a was implemented to build and test the suggested method on underground distribution and transmission line models. The simulation results revealed that the developed fault detection and localization technique is capable of accurately detecting and locating faults on distribution and transmission lines. The method proposed can assist power system operators in swiftly locating the fault and taking the necessary procedures to restore power supply. Overall, this article is a valuable resource for increasing the reliability and efficiency of electricity transmission and distribution networks.