Step 1: If an object is moving in a circular path of radius R with velocity v, some force must be pushing or pulling it towards the center of the circle. How large must that centripetal force be?
Step 2: In the case of a planet (mass m) moving around the Sun (mass M), gravity provides this force. How strong is the force of gravity in this case?
Step 3: Setting these two forces equal to each other gives us a relationship between the square of the velocity v and the radius R.
Step 4: If a planet moves around a circle of radius R with speed v, how long will it take to make one complete revolution? We call this the period P.
Step 5: Take your expression for period and square it, so that you end up with velocity squared on the bottom of the right-hand side.
Step 6: Almost there! Just re-arrange things so that all the terms with P go on the left, and all the terms with R to on the right. What do you get?