To cycle a tank you need to grow denitrifying bacteria to consume ammonia and nitrite that your tank produces. The bacteria needs an ammonia source to grow colonies sufficient in size to consume all the ammonia and resultant nitrite and turn it into nitrate which typically you remove through your regular water changes.
Two commonly used methods to cycle a tank are called a “fish in” cycle and a “fishless” cycle.
A fish in cycle uses fish waste as an ammonia source and regular water changes are undertaken to ensure that water parameters are maintained at relatively non toxic levels. This has been the go to method to cycle a tank for many years, and it commonly is the way new fish keepers cycle a tank when they have bought fish with no knowledge that a tank needs cycling and how to go about it.
Pros.
You get to keep “some” fish pretty much on day 1 of setting up your tank.
More consistently gets you through your cycle.
Only real choice if you already have fish.
If done simply, eg stock lightly, add fish slowly, you can fishless cycle safely without testing. Although testing your water while cycling is still a good idea.
Cons.
Lots of water changes, especially if you are doing a fish in cycle with a fully stocked tank.
Although you should be doing plenty of water changes to maintain relatively safe water, your fish will be living in waste which isn’t ideal.
Can take a long time (several months) to go from an empty tank to fully stocked if done safely.
A fishless cycle uses an ammonia source to replicate the fish waste that a tank of fish would produce. This ammonia source can be pure ammonia, an aquarium specific ammonium chloride product like Dr Tims Ammonium Chloride, a cocktail shrimp or fish food.
Pros.
You cycle the tank before adding fish, therefore they shouldn’t be exposed to their own waste.
No need for regular water changes while your tank cycles.
Can be quicker to go from an empty tank to fully stocked.
Cons.
Needs patience, you will be looking at an empty tank for several weeks.
More technical approach requiring dosing ammonia and will need to be done alongside regular testing.
Less consistently successful than fish in cycles, especially with new fish keepers who don’t understand the process and expect it to run to a timetable.