Yakuza 0 was a prequel made as part of the series' 10th anniversary project.
Yakuza 0 is a prequel that takes place in 1988, literally 7 years before the start of the first one (and then you have a ten year time skip in the first one so it really takes place in 2005, making it 17 years before Yakuza 1).
The thing to remember about the Yakuza series is that almost all the games are self-contained. The story of one does not affect the story of another. Yes the protagonists and supporting cast does carry over and they do grow as characters but the villains are ALWAYS new people and the story is always new.
But the thing about Yakuza 0 is that it's an incredibly well made game, and that it gives backstory to characters in Yakuza 1 that barely even got any backstory in that game. The mere existence of Yakuza 0 elevated Yakuza 1's story even though it had ZERO (pun not intended) connection to the overall plot, simply through giving characters development and time to show off their personality. That being said, Kiwami was made keeping the events and actions of Yakuza 0 in mind and incorporated it into the game making the transition much smoother and making the story feel as if it's a two-part series or something.
So yeah, play Yakuza 0 first then Yakuza: Kiwami. You CAN play it the other way around but I wouldn't recommend it personally. That's also the official SEGA recommendation.