This paper proposes the use of a PV–wind–diesel generator hybrid system in order to determine the optimal configuration of renewable energy in Malaysia and to compare the production cost of solar and wind power with its annual yield relevant to different regions in Malaysia namely, Johor, Sarawak, Penang and Selangor. The configuration of optimal hybrid system is selected based on the best components and sizing with appropriate operating strategy to provide a cheap, efficient, reliable and cost-effective system. The various renewable energy sources and their applicability in terms of cost and performance are analyzed. Moreover, the annual yield and cost of energy production of solar and wind energy are evaluated. The Simulations were carried out using the HOMER program based on data obtained from the Malaysian Meteorological Centre. Results show that, for Malaysia, a PV–diesel generator hybrid system is the most suitable solution in terms of economic performance and pollution. However, the cost of production of solar and wind energy proved to be cheaper and more environmentally friendly than the energy produced from diesel generators.