Start here:
Process.Kill Method (System.Diagnostics) | Microsoft Docs[
^] and read what it says.
For example:
Note
The Kill method executes asynchronously. After calling the Kill method, call the WaitForExit method to wait for the process to exit, or check the HasExited property to determine if the process has exited.
Note
The WaitForExit method and the HasExited property do not reflect the status of descendant processes. When Kill(entireProcessTree: true) is used, WaitForExit and HasExited will indicate that exiting has completed after the given process exits, even if all descendants have not yet exited.