Open the Settings application - Either by going to the Start menu and click the Settings button: Or by typing "Settings" into the search and open the Settings application:
Click on System which is usually the first item on the left side of the window
Click About
Look in the Device Specifications section for the Device name line.
...
macOS
Expand
title
Instructions for Mac
Click the Apple Logo in the top left corner of the screen and select System Preferences:
In the window that appears select Sharing:
This will move to a new page, showing the name of your computer.
Info
title
NB: macoS Ventura Differences
On macOS 13 (aka "Ventura"), the settings are organised slightly differently.
Go to Apple logo > System Settings > General > Sharing and scroll until you see your computer name listed under Hostname at the bottom of the settings pane: