If you do not have yay
installed, then follow these steps to install it first
yay
yay -S docker docker-compose
sudo systemctl start docker.service
If the above command throws an error, then do the following
sudo systemctl enable docker.service
reboot
sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker