How does stream cipher works? I will be grateful if someone can explain how stream cipher works using Pseudorandom generator(PRG).
Steam ciphers work by encrypting the counter / nonce with the master key (generated from a cryptographically secure psuedo-random number generator).

For example with AES in CTR mode, you would run the usual AES Encryption algorithm, but instead of inputting a message you input the counter/ nonce.

This creates a stream. A portion of the stream equal to the length of the message you want to encrypt is XORed with the message, and sent to the recipient.

As for the psuedo-random generator, a stream cipher can be used as a PRG, but there isn't a PRG in the stream cipher itself, as both parties have to be able to construct the key and encrypt / decrypt the message.