Electricity markets are evolving into a complex competitive business environment with an increasing role of the private sector in production, consumption, and retailing of electricity. Even transmission and distribution activities have private share in many countries. Technology is also rapidly adding new concepts such as smart grids, batteries, and prosumers (participants that are both on the production and consumption side). This study first gives a brief history on the liberalization of electricity markets, specifically concentrates on the Turkish markets. Other European markets also had similar historical developments. Secondly, we provide the market participants and their roles as well as briefly introduce the problems they need to solve. Then the paper discusses the market types such as day-ahead market, intraday market and balancing power market. Furthermore, we explain the auction mechanism to determine prices in these markets. Finally, we give an illustration for predicting the electricity prices of next days using a forecasting methodology called ARIMA. We use a real data set from Turkish market and provide a step-by-step procedure for calculating the prices using an open-source statistical software R.