A fingerprint is a short way to confirm that two people are looking at the same certificate. OpenSSL calculates it in one command.
openssl x509 -fingerprint -sha256 -noout -in cert.pem
The manual explains -fingerprint as printing the digest of the DER-encoded certificate. -noout suppresses the certificate itself so only the requested output appears, and -in names the file. Without -in, the certificate is read from standard input.
Any digest supported by openssl dgst can be selected the same way, which is why -sha256 works.
The caveat is the default. The manual says that when you use -fingerprint without a digest option, SHA1 is used. SHA-1 fingerprints are still printed by many tools, but if you compare against a SHA-256 value, say so explicitly, or the two will never match.
Also be clear about what a match proves. It shows that the certificate in your file is the one that has the fingerprint you compare it to, and that is only worth something when the reference value comes from a trusted second channel, such as the administrator of the server telling you in person. A renewed certificate gets a new fingerprint, so a changed value after a renewal is normal. Compare again with a fresh reference.
Further reading: OpenSSL: openssl-x509