The safest way to install any software is through official channels. This includes:
Be wary of installation scripts that require administrative or root privileges without a clear reason. Minimalist permissions are always safer. 4. Use Sandboxing
Using well-known platforms that vet the software they host. Risks of Unofficial Software "Krews" or Repositories