Service principal decouples the flow from the user. So it removes the dependency between the flow and user. If user is inactive or deleted flow will not be affected.
Steps to use service principal in your flows.
First Register app in azure portal
Second click on new connection reference
Third , connect with service prinicipal and provide the details from your azure portal
Click Create