Theory of random fields or random processes is presented with an emphasis on the possible choices of correlation functions. Then two methods for generating Gaussian random fields in Rd are presented. The first method is a direct one but does not work for a too large number of locations. The second one is called the circular embedding method, works with large number of locations and had been introduced independently by Wood and Chan (1994) and Dietrich and Newsam (1993). It is exact in principle for correlation functions with compact support and an approximation method is given otherwise. Those methods have been implemented in R and validated by means of variogram comparisons. Finally Max-stable processes are introduced, the simulation procedure from Schlather's model is presented and max-stable process is simulated with help of the circular embedding method.