It is important to pay attention to environmental regulations while preparing drilling mud because it has become aspects that must be taken into consideration both now and in the future. It is essential to use sustainable and environmentally friendly materials at every stage of the oil and gas industry if possible in order to ensure high standards of sustainable practices. Oil that has been used to prepare oil base mud have bad impact on soil and human at the same time. The using of flaxseed oil instead of gas oil to preparing emulsion is done in this paper. The results were encouraging, and showed the possibility of using flaxseed oil for preparing ecological emulsion. The efficacy of walnut shell powder as an emulsifying agent has been tested as a surface tension reducer and the possibility of using it to increase the stability of an oil emulsion either in reverse or direct at high temperatures (400°F). This research includes measurements of filtration, stability and rheological properties of oil emulsion under laboratory and high temperature. Sample C showed high stability less than 3% because it is a direct emulsion composed of 10% flaxseed oil and crushed walnut shells, which acted as an excellent emulsifying agent because it was composed of cellulose with a percentage of more than 40%. Sample E gave the highest viscosity values, and the reason for this is that it is a reverse emulsion consisting of 60% flax oil with a high viscosity, as it reached more than 70 centipoises at 400 degrees Fahrenheit.