Phase-field approach has become a very powerful computational tool for the study of microstructure in materials. By introducing the field variables, it allows naturally tracking of the evolution of interfaces which are essential to the complex microstructures of functional materials. Other advantages of the phase-field approach include its flexibility of combining different field variables and adding new physics. In this presentation an introduction is given on basics of the phase field theory. In this work, the speaker will present mainly her current work on phase field modeling of relaxor ferroelectrics based on random field theory. Even though relaxors may have different origins depending on the materials, in a generic sense they all lead to internal random fields. The influence of the random field on the ferroelectric features will be demonstrated. In addition, phase field modeling on ferromagnetics with consideration of thermal fluctuation and on phase segregation in Li-ion battery electrode materials will be introduced.