By default, the Telnet client is not installed on macOS.
General steps to install telnet commands in your Mac machine.
Open Terminal and start to install Homebrew on macOS.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Input your administrator password and authorize the installation.
Once Homebrew is installed, can start to install the telnet client with the following command.
brew install telnet
When installation has been completed, you can run Telnet as usual:
telnet [hostname/ipaddress] [port number]