They basically split people at a certain area into two groups, give one the real thing, another one placebo, track infections, compare the results.
Comparing vaccines by effectiveness is meaningless because they're not all tested at the same place at the same time. So J&J has lower effectiveness, but it was calculated at the peak of the outbreak, when each participant interacted with Covid more frequently in their everyday lives.
For the comparisons to become meaningful, it'd need to be re-done at the same place at the same urban area, with 10s of thousands of participants for each vaccine. You'd also need to have approximately similar age spread, plus similar population distribution within an urban area. Since it's all volunteer-based, this kind of study won't happen.
In conclusion: take any that's available to you.