Select your operating system for a guide on how to enable Chinese text input.
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.
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
Most people who live in mainland China install a 3rd-party input method. Sogou Pinyin Input is very popular.
The Sogou input method has advantages:The downside is the software must monitor all keystrokes to function, so you need administrator privileges to install it.