From my point of view, there is no such thing as "proper and correct instructions" working on every Mac when on terminal level.
@dakwar already stated above that he only recommends using such tools if you "have a few troubleshooting skills in your tool belt", and I would second that. He also already pointed out why these terminal commands will always differ between different machines and user configurations.
When using the macOS Terminal, you are starting to interact with your Mac like any other Unix machine on shell level - which means you're leaving the realm of the very comfortable and "fool-proof" sandbox which is built up by the macOS frontend and start to interact with your Mac more directly on machine level. This allows you to perform operations which are not possible from the frontend, but this comes at the expense of you giving precise machine orders and the Mac just following your orders right away, sometimes even without asking again - which means even small mistakes can lead to severe consequences like unintended data loss.
Therefore, I strongly do not recommend using terminal commands if the commands are just cryptic stuff to you and you do not really understand what is going on. This is like a kind of russian roulette - in some cases it will just work and produce the intended results, but in many other cases there will be subtle differences between your machine and the machine of the person who created the terminal command, and in this case the command will just not work (if you're lucky) or even cause unintended results (if you're not so lucky) and leave you behind clueless without the chance to properly understand and troubleshoot what just happened.
The terminal shell is a great tool if you are willing to invest the time required to learn and understand how it works. This does of course not mean you have to become a capable hacker in the first place before even starting to use it, but there should be at least some basic knowledge of what's going on before typing in things that you might regret soon.
But if you're willing to invest some time and spent some interest, the terminal is an absolutely great thing and will allow you to become a much more capable skilled user, being able to successfully deal with a lot more problems than before.
Having said that, I can confirm that the solution proposed here works quite well, also on M1 Macs (...also as proposed by
@dakwar, if you correct the small back slash error he made and adapt the paths to your machine and configuration).