Learning how to write programs
To win a medal at the IOI, you need to know how to program in one of the allowed programming languages, to be able to understand and implement algorithms, and to be a good problem solver.

The most commonly used programming language by competitors is C++. If you don’t have any experience with programming, you may start learning C++ from any of the following pages:

1) These tutorials explain the C++ language from its basics up to the newest features introduced by C++11. Chapters have a practical orientation, with example programs in all sections to start practicing what is being explained right away.

2) LearnCpp.com is a free website devoted to teaching you how to program in C++. Whether you’ve had any prior programming experience or not, the tutorials on this site will walk you through all the steps to write, compile, and debug your C++ programs, all with plenty of examples.
Learn about algorithms
Next, you should start solving various algorithmic tasks and learn about data structures and popular algorithms.
A couple of good pages with regards to that are:

1) The United States of America Computing Olympiad (USACO) is a computer programming competition for secondary school students in the United States. The USACO offers six competitions during the academic year for students at four increasingly difficult levels: Bronze, Silver, Gold and Platinum. It even has a training section where you can learn and practice algorithms.

2) Codeforces is a Russian website dedicated to competitive programming. It was created and is maintained by a group of competitive programmers from Saratov State University led by Mikhail Mirzayanov. Since 2013, Codeforces has surpassed TopCoder in terms of active contestants.

Finally, you can find a couple of book recommentations on this site, listed here.
If you are a first-time participant of an IOI, either as a delegation leader or deputy, an observer, or a competitor, then it is advisable to read some of the reports and tasks from previous IOIs. Every IOI is different, but the changes should not be very drastic (mostly).

It might also be a good idea to look at problems from past Olympiads, which are available on the Editions page.