Download the latest full (not “Lite”) version of Raspberry Pi OS or Raspbian from the official Pi downloads page. You’ll also need a keyboard, mouse and monitor attached. Write the OS to an 8GB or larger SD card, insert in the Raspberry Pi and power it up. After a minute or two you’ll see the Pi desktop.
On first boot, the system will prompt for some basic configuration like language and time zone. Once that’s set up to your liking, some additional configuration is needed…
From the “Pi” menu at the top left, select Preferences→Raspberry Pi Configuration…
Select the Interfaces tab.
Turn Serial Port ON, and Serial Console OFF, as shown in the image.
Click the “OK” button. You’ll be asked whether to reboot. Select “Yes” unless there’s other setup you want to do on your own first (such as networking) before rebooting.
Alternately, you can do this through a Terminal window if that’s more your style:
You’ll find the Serial Port settings under “Interface Options.” Select “No” for the login shell, and “Yes” if asked about the serial port hardware (this option might not show up on older Pi models, where it’s always on). Tab over to “Finish” and reboot when asked.