This post is quite old now.
If it's a technical article, this means that some of the information in this post might be out of date.
I'm going to presume you already have Valet and Homebrew setup. To install Imagick, there's a couple of commands you'll need to run:
brew install imagemagick
brew install pkg-config
(also if it's already done)pecl install imagick
valet restart
In case you get a Connection Timeout when visiting one of your Valet sites, you may need to reinstall Valet with valet uninstall && valet install && valet park