1. First, check the prerequisites for your MacOS version with your .NET SDK version from the below link: Microsoft
2. Now you have to locate dotnet.exe. It may be in one of the below paths:
/usr/local/share/dotnet/x64/dotnet ( for newer versions)
3. After locating dotnet.exe, you have to create a new symbolic link to create a new shortcut link to that dotnet.exe file in the usr/local/bin folder. For that, you can run the below command in the terminal:
ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/
ln -s /usr/local/share/dotnet/x64/dotnet /usr/local/bin/
Select the command as per your dotnet.exe location.
4. If you find this error “/usr/local/bin//dotnet: File exists” that means the symbolic link is already there but it might be broken. For that you have to delete that from /usr/local/bin/.