If you have XWiki running inside Tomcat then you need to add a SSL certificate and fiddle with the configuration in the conf\server.xml file. This is explained in the tomcat documentation, i.e. here:
It might be easier to add a second server like Apache or Nginx to handle the https part (and also to redirect all http-requests to https). In case of Nginx this is documented here:
(though the documentation is somewhat Unix-oriented). I have been able to get Apache set up with https under Windows successfully some time ago, but I need to dig out my notes about that.
In that case it might be easier to get a SSL certificate via “LetsEncrypt” as for these servers ready-to-use scripts exist to assist with fetching the certificate. However this only works if your server is connected to the internet and has a valid name. For installations on “localhost” you will need to use “Dummy”-certificates. (How to create such a SSL-Certificate via the commandline is explained in the above tomcat documentation.)