I tried switching my website to HTTPS but it’s giving me an error 502/521, and my hosting provider asked me to contact CloudFlare for support. You can see the site at mrrahmatsphysicshub.space.
You are set to use SSL full which connects to the origin server on port 443. Your server is not listening on port 443. You can try using flexible or install an origin certificate on the machine hosting your content.
How can I do that? Is there a step-to-step guide?
Step by step really depends on platform. Here’s a general and the sidebar has links to a number of other possible platforms: