If you don't give us any details of your project, we can't do better than Google. Speaking of which, have you tried Google? What did you think of the information you found? How is it lacking? Perhaps you can put together a much better question after you have done some research.

What kind of game are you talking about? Randomly generating a solar system for a space game is going to be different from generating a forest for a hunting game, a city for a commercial game or a tile based continent for a large RPG.

Your question isn't very detailed, but if you wan't to create random "anything", you would use a random function for whatever language. The documentation for the language you are using should tell you what function to use. (look for stuff that says "rand" or "Math::Random") Really it's more about experimenting and figuring out how to randomly "grow" your environments by creating objects in random locations and having other objects generate from them randomly.

If you want to be lazy, and if you're using a language like C or C++, you could use rand() or an equivalent if you really wanted, but that's not a particularly robust way to do it. One possible way I've found is to use pseudo-random number generation and just iterate through a fixed-size array that way, but you may or may not need that kind of implementation depending on your uses. Good part about that kind of thing is that it's blazing fast, and it's virtually random as far as the user cares since you're not revealing the deterministic logic to them directly.

Perlin noise is often very useful for generating levels, although there isn't enough detail of the problem to know whether it's applicable to you. Regardless, it's worth learning about if you're doing randomised procedural generation of pretty much anything.

If you want to be lazy, and if you're using a language like C or C++, you could use rand() or an equivalent if you really wanted, but that's not a particularly robust way to do it. One possible way I've found is to use pseudo-random number generation and just iterate through a fixed-size array that way, but you may or may not need that kind of implementation depending on your uses. Good part about that kind of thing is that it's blazing fast, and it's virtually random as far as the user cares since you're not revealing the deterministic logic to them directly.

FWIW, rand() is a pseudo-random number generator. When used with the same seed, it will generate the same random numbers over and over. However, in saying that, I still don't think your post makes any sense at all and doesn't cover how to create a random world at all.