@yogita
If your PC originally came with a factory-installed Windows 8/8.1 Core Single Language instance (e.g.
this one), then it should have a unique MSDM key in your firmware (commonly referred to as BIOS). In that case, an unaltered Windows 8/8.1 installation media should automatically recognize the key during the installation phase. You just need to be online after installation to be activated. In fact, it is possible to use a Windows 10 media as well, since it can recognize the 8/8.1 MSDM key and apply for the relevant digital license token on the fly.
However, if your PC came without Windows (or a different edition of Windows other than the aforementioned ones), then you need to obtain a valid key.
Can you please post the output of the following command (to be executed from Run or Command Prompt) so that I can guide you better?