Remote Access of a Raspberry Pi: GUI
If you prefer to access the graphical user interface (GUI of the Raspberry Pi from your Mac or PC, you must enable VNC for your device and then access it using a VNC viewer, for this illustration Real VNC viewer is used.
Enabling VNC

Note: If your terminal/command prompt session was terminated,
SSH back in to your Raspberry pi.
While still in the command prompt/terminal, make sure you have logged into your raspberry pi,
Type the command sudo raspi-config and press return/Enter to open the raspberry pi configuration tool.

Navigate to Interface Option and press return/Enter. (navigate using the Up and Down arrows in your keyboard).
Navigate to VNC and press return/Enter. (navigate using the Up and Down arrows in your keyboard).

Select Yes for enable VNC and press return/Enter. (select using the Left and Right arrows in your keyboard).

Select
Ok and press
return/Enter.

Select Finish and press return/Enter (select using the Left and Right arrows in your keyboard).
Virtual Network Computing (VNC) is now enable for your raspberry pi.
Raspberry Pi GUI access using VNC viewer
Now that you have enabled VNC in your raspberry pi, you can now download Real VNC viewer and access the GUI of your raspberry pi remotely.
Download and install the appropriate software for your Mac/PC.
Note: Click Open or Proceed if any confirmation pop-up occurs.Open the VNC viewer installed in your application.
Click on Use RealVNC without signing in.

Enter your <hostname>.local in the VNC viewer address bar and press return/Enter. For this illustration, myrpi.local is used

Click Continue in the VNC not recognized pop up.
Provide the username and password of your raspberry pi. For this illustration, the username rpiuser is used. Credentials provided during the raspberry pi imager configuration must be used.
The GUI of your raspberry pi will now be displayed in a window, you can maximize the screen and use the VNC tab as the monitor of your raspberry pi, while your Mac/Pc's keyboard and mouse becomes the keyboard and mouse of the raspberry pi.

For Mac, click Give access in the VNC requires access confirmation. If the Accessibility Access window appears click Open System Settings > enable for VNC viewer.
With this the set up of your raspberry pi is completed.