Go to Apple menu > System Preferences > Accessibility > Keyboard > Accessibility Keyboard > Enable Accessibility Keyboard. You can also turn on the Accessibility Keyboard from the Input menu by selecting Show Keyboard Viewer.