Recent versions of Ubuntu come with built-in kernel support for AMD graphics cards through the open-source AMDGPU driver.
NOTE: The default open-source driver should be perfectly suitable for most users, offering performance and stability.
Update your system:
sudo apt update && sudo apt upgrade -y
Install required packages:
sudo apt install linux-headers-generic build-essential dkms
Select the required Installation Method.