You can visit either by bus service or cab services which are being provided by the Karnataka state government.
https://ootycabs.com/how-to-reach-ooty-from-mysore/