In order to create a pfx file we will need the certificate (crt file) and the private key file.
We need to download and install OpenSSL for windows https://slproweb.com/products/Win32OpenSSL.html.
The first step is to give the same filename to both files (crt and private key) and give the extension .key to the private key file.
So assuming we have the 2 files certificate.crt and certificate.key we have to open OpenSSL and execute the following command:
openssl pkcs12 -export -out newcertificate.pfx -inkey certificate.key -in certificate.crt
We will be asked for a password for the pfx file and we are done.