After you are done with the second layer on the Rubik's Cube, you will be faced with 4 cases. 1 case is that the yellow cross is already done(as shown above), the other 3 are shown below.
In all three cases, F R U Ri Ui Fi is used. This formula will get the cube from one of the above case into another. Repeating it will eventually form a yellow cross on the top of the Rubik's Cube.