Firstly you need to decide how soon you want to populate the tank do determine how you are going to cycle it
Ideally when time is plentiful you’d cycle the tank with no fish by ghost feeding or dosing ammonia. It’s the most controlled method of cycling and you don’t risk any fish.
If you want to populate the tank immediately, a fish-in cycle can be done relatively safe if you keep a close watch on water parameters and water changes. Just dont start off with a whole bunch of fish, start with a few and let things stabilize, then add more
As far as how long to cycle, there’s no answer for that other than “until it’s cycled”. Your growing a colony of beneficial bacteria that establish the nitrogen cycle in the tank, there’s a billion variables at play in their development. It can take a week, it can take 8 weeks, it may never cycle if conditions aren’t favourable!