The integrity of a safety system involves ISO 13849-1, among others. That standard is not simple to deal with.
Much depends on the age of the equipment involved. If you go back a number of years, before "safe torque off" was invented, and before compliance with ISO 13849-1 was something that needed to be considered, it was pretty common to just cut the run signal inputs, rightly or wrongly. Nowadays ... don't do that, unless the risk assessment indicates that it is permissible (e.g. very low-risk application). Standard motion-command drive inputs are not considered to be safety-rated.
It's not uncommon to use a controlled-stop followed by a delayed-safe-off: Remove the motion command immediately in order to activate the dynamic-braking function, then after either a time delay or a detection that the motion has stopped, open the STO inputs and, where applicable, have the mechanical brake apply. You can readily obtain safety relays with immediate-off and delayed-off contacts in order to implement this.
Depending upon the risk analysis, the equipment may need to incorporate guard-locking so that people cannot access the moving parts until the motion is known to be stopped.
Safe-torque-off can take the form of hard-wired dual-channel inputs to a safety-inputs terminal block on the drive, or it can take the form of the drive being a safety network node on a ProfiSafe or ethernet safe I/O network, in which case, a safety PLC is making the decisions about what to do.