How to create a subdomain for a nodejs api with ssl?

I have been able to create my subdomain and configure it to work with nodejs, the problem is the ssl certificate, it is installed but the browsers recognize it as an error, I have tried to install it manually with certbot but have not been successful. Somewhere I read that I had to create my subdomain and first configure the ssl before adding the backend in node because it does not allow to check the domain. I’m totally new to this

Check the below tutorial, it will be one of the best SSL tutorials for ssl issues related to CyberPanel How To Get FREE SSL/HTTPS in 5 Minutes with Let's Encrypt using CyberPanel - YouTube