:Step 1:
put this URL on your ardunio ide at following address
File->preferences->Additional Boards Manager URLs
URL:
http://arduino.esp8266.com/stable/package_esp8266com_index.json
Step 2:
go to Tools->Board->Board Manager
and search ESP8266
then install last version esp8266 board manager
Connect ESP8266 with usb to computer and then select PORT
upload and DONE