Ethereum Blockchain is a deterministic Turing machine, meaning there is no randomness involved. If there was a random opcode in place, all miners would obtain different results and the network would be unable to reach a consensus.
There are currently several approaches for generating random numbers:
What is the best way to generate random numbers on-chain? It would be ideal if we can assign each listed approach to potential decentralized applications.