An ship travels a distance vt (distance equals velocity times time). An observer at rest measures this distance with his own clock in units t. Someone on the ship measures a beam of light traveling perpendicular to its direction of motion to measure a beam of light to travel a distance ct', where t' is the number of units of time that someone on the ship would use. The observer at rest measures this same beam to travel a distance ct, that is traveling at an angle towards its direction of motion. You can then translate the vector vt down to the point where the photon has traveled the same distance perpendicular to the ship. This forms a right triangle. Then you can use the Pythagorean Therom to find the relation between the ship and the observer.
(ct')^2+(vt)^2=(ct)^2 Pythagorean Theorem
c^2t'^2=c^2t^2-v^2t^2 Distribute the square, and move v^2t^2 to other side
c^2t'^2=c^2t^2(1-v^2/c^2) Factor c^2t^2 from the right side
t'^2=t^2(1-v^2/c^2) Take the square root
t'=t sqrt(1-v^2/c^2) Learn to do algebra!
Notice this is not the same equation from the light clock example. People now refer to this t' as tau or the proper time. The only difference in the other time dialation formula is the time variebles are assigned differently (the other way doesn't make sense to me), and it assumes that you can find the dialated time by taking the inverse of the change in time(wrong relation to frequency). This clock doesn't tick, it is only a direct relation between the distance of the sides of a triangle, and the amount of time something would measure it to travel that distance. So in another words time does not slow down because the clock is seen to tick slower, time slows down because the clocks in the ship tick fewer times when an observer at rest sees light to travel a longer distance(all observers measure light to travel at the same speed in vacuum). Also note that these two equations can't be used together, and it has been said that Einstein even wrote this equation in his Special Theory of Relativity. I think it is the right one and the other should be thrown out. If you derive length contraction from "tau" you end up getting the same equation...