Well, you know that, in the spacecraft's reference frame, it takes 3 years to make the trip - but in the spacecraft's reference frame, what distance do they travel?

Or, you know that in the Earth's reference frame, the distance traveled is 4 light years - but how long, in the Earth's reference frame, does it take to make the trip?

I'm sure you can set up an equation for either of these viewpoints. Remember that u is the speed of the ship in the Earth's reference frame, or equivalently the speed of the Earth (and Alpha Centauri) in the ship's reference frame. It'll be a little more complicated than just dividing distance by time to get the speed, but not much.

No. You don't use length contraction and time dilation at the same time.

From the perspective of Earth, the spaceship clock runs slow. That's all you need. Length contraction will also mean the space ship is shorter, but that does't change how far it has to go, which is still the same as far as Earth is concerned.

You can repeat the calculation from the perspective of the ship. In this case, there's no time dilation! As far as the ship is concerned, what you know is the time it take... but the distance is no longer 4 light years! It is distance contracted.

Which ever way you think of it you should get the same answer for the required velocity.

You see a star that is at a distance of 4 light years. You have a space ship that moves with some velocity v.

How long does it take the spaceship to get there, in terms of v, as measured on Earth? Forget time dilation. This is time as far as you are concerned, on Earth. You don't need any relativity for this step.

Write this down, as an expression in terms of v, even if you can't do anything else as yet.

Now... the next step. How long does it take on board the spaceship? Write this down, using the total time from the previous step, and a time dilation factor.

Finally.... what you have just written down is equal to 3 years. Solve for v.
​

OK... I see you have already done this. Well done.

Now you want to do it all again, but this time from the perspective of someone on board the spaceship!

This time, the spaceship clock reads 3 years for the trip. They are traveling at velocity v. So what is the distance they must have traveled? This is an expression, in terms of v.

Now this distance is 4 light years, contracted from the point of view of the spaceship. Write down the expression, in terms of v, for distance.

You now have ANOTHER equation you can solve for v. You should get the same answer as last time!