Select your operating system for a guide on how to enable Chinese text input.
Go to System Preferences. Choose Keyboard Choose Input Sources, then click + Select Chinese (Simplified) - Pinyin - Simplified then click Add Make sure Show Input menu in menu bar is checked. Use the language icon in menubar to switch modes.
Type in Pinyin, and select the character.
It is a good idea to create a keyboard shortcut to switch between input modes. Control + Space is a popular choice.
Go to System Preferences. Keyboard Shortcuts Input Sources
Check Select the previous input source and set the shortcut to ^Space
Most people who live in mainland China install a 3rd-party input method. Sogou Pinyin Input is very popular.
The downside is the software must monitor all keystrokes to function, so you need administrator privileges to install it.