Public key certificate is a digitally signed document which verifies the sender is indeed the person. May I know how can the receiver tell the sender is indeed the person solely based on information on the public key certificate? What are contained in the certificate? Does a public key certificate contain the same information as in any certificate?
You actually don't trust the certificate by itself. A certificate is like a diploma that a company (or a domain, e.g. www.crypto.com) obtained from some trusted party, called CA, or Certificate Authority. This diploma states that www.crypto.com is allowed to communicate with you using the public key written in the diploma.
But, as you mentioned, www.crypto.com could generate that diploma to itself, then why should you believe them that the public key written in that diploma is realy theirs and not belongs to some man-in-the-middle attacker?
Here comes the signature part in the diploma. The CA attaches to that diploma a digital signature on www.crypto.com's public key, and you, as their client, verify that indeed, the signature is valid (you do so by applying the CA's verification key on the signature). By definition, nobody can forge that signature and trick you, i.e. to make a valid CA's signature on a fake www.crypto.com's public key.
A crucial key point here is that there exists a 'chain of trust', i.e. you'll believe www.crypto.com only if some CA that you trust tells you to believe it. By default, every browser (and operating systems) is bundled with a list of trusted CAs.
What Bush said. For your device to actually verify the certificate it does indeed need to know the actual cryptographic algorithms that the certificate uses. It needs to use them on your end to do the math and verify with the issuer's (CA) root certificates that the certificate is valid. As stated above these root certificates are usually included with OSes/browsers/other applications.
Additionially, a web browser will often allow you to view the details of the certificate, for you as a human to verify that you trust the CA and any certificates that they issue in the chain of trust. Along with this the details of the algorithms used are also usually included, so you can make a judgement call as to whether you trust the algorithms and bit lengths used.