SEO – What is the best way to redirect from one page to another for a multilingual site?

I have 5 languages ​​on my website

  • site.com (home page in English)
  • site.com/esp (Spanish)
  • site.com/ger (Germany)
  • site.com/ru (Russia)
  • site.com/it (Italy)

The question is, what is the best way to redirect users from one page language to another? The system on my website determines the language of the browser and redirects it to it. But if I use 301 redirect, it's very bad for SEO (paste or domain cover-up). I need a good solution for SEO and users.

Thank you