Yemyht
You have to connect to server via SSH or terminal. aaPanel has its own terminal. You can use it too.
Check the version of affected PHP. Just use the command below:
For CentOS
PHP 7.4
yum install lsphp74-imagick -y
PHP 8.1
yum install lsphp81-imagick -y
PHP 8.2
yum install lsphp82-imagick -y
PHP 8.3
yum install lsphp83-imagick -y
For DebianOS
PHP 7.4
apt install lsphp74-imagick -y
PHP 8.1
apt install lsphp81-imagick -y
PHP 8.2
apt install lsphp82-imagick -y
PHP 8.3
apt install lsphp83-imagick -y
Restart your PHP service after installation.
You can confirm the ImageMagick installation from the PHP info page.

Fill free to reply your query, if any.