Basically you need the .NET Core *currently only . NET itself, but it is not the Framework) that is the new implementation of .NET. It works on the three main desktop operating systems.
For mobile operating systems you can use the Xamarin *which is now . NET). It works on the 3 main platforms. See more on Xamarin is a viable option for mobile development? and /a/38752/101.
Both . NET Core and Xamarin are fully supported by Microsoft. And compatible in essence. If you do the basics, what you do with one will run on the other.
Also has the Mono that works on the desktop but today has little reason to use it, you need to have a specific need to compensate for its adoption. On mobile devices it even works but so limited and with additional effort that I doubt there is a case that makes up for its use. It tends to be in the background with the adoption of . NET Core.
There is no way to create applications 100% cross Platform. You will always have to use specific libraries, you will have to write code thinking about the differences of operating systems.
Java sells this idea that you make a code and run anywhere, but doesn’t tell you that you need your effort and that in some cases it gets bad in all operating systems.
The specifics of what you need to do to ensure that it runs well on all platforms is best to ask specifically when having problems.
It would be interesting to meet the .NET Standard which is the portable way of developing applications. With the . NET 5 this becomes less relevant.
Even Java (and .NET) have to write different implementations of their own Runtime for each platform they want to support. At most, most of the code is the same and only changes the part that interfaces with the operating system. And if an OS offers a feature that others do not offer, you have to choose between not using/offering that feature or otherwise "perfectly" cross-Platform...
– mgibsonbr