To compile and execute C# programs on Mac, firstly you need to IDE. On MacOS, one of the best IDEs is Monodevelop.
Monodevelop is an open source IDE that allows you to run C# on multiple platforms i.e. Windows, Linux, and MacOS. MonoDevelop is also known as Xamarin Studio.
Monodevelop has a C# compiler to run C# programs. It can be used on Windows, macOS and Linux.
For Mac, a special version of MonoDevelop was introduced and it was called Visual Studio for Mac. It has many of the features of what the same IDE provides for Windows like a tool for and IntelliSense and refactoring.