Rules Primer:
https://www.games-workshop.com/resources/PDF/40k/warhammer_40000_en.pdf. This explains the basic operations that happen during the game.
The full rules are contained in the Warhammer 40000 8th edition rulebook, which contains lots of fluff, as well as the rules for three different kinds of play (the kind called Matched Play is most common, and is the competitive play rules that strives to balance armies), the rules for terrain, scenarios with victory conditions, etcetera.
Each army has its own Codex. This is where you find the statistics and special rules for each kind of unit for that army. Note that some units are made by Games Workshop's resin casting company called Forge World, and they have their own, additional unit entries not contained in the Codex. In the current Tau codex, the only auxiliaries supported are Kroot (Kroot Carnivores, Kroot Shapers, Krootox and Kroot Hounds) and Vespid. Vespid and Kroot Hounds are considered good units, while Kroot Carnivores aren't bad, but aren't really good either. They get to deploy closer to the enemy than is normal, but die like flies due to their low armor save. You can build a very big army of them and rely on numbers to carry the day, however.
Every army has units labeled by role:
HQ (leaders who buff units or do special things), Elites (expensive units with special rules and weapons), Troops (regular soldiers, though in
40K they can get quite weird), Fast Attack (speedy units), Heavy Support (Tanks, big guns), Flyer (airborne gunships), Lord of War (REALLY big guns or special characters), and Fortifications (bunkers, gun emplacements).
Armies get special bonuses by being Battleforged, which means that they have taken units to fill detachments. For example, a Patrol Detachment must have 1
HQ and 1 Troop unit, but can have as much as 2
HQ, 3 Troop, 2 Elite, 2 Fast Attack, 2 Heavy Support, 2 Flyers. All those units must come from the same army - generally the same codex, but again some Forge World units can fit in. They have a system of key words that tells you what army a unit belongs to. For example, a Tau Ethereal has the Tau keyword, so they can lead a Kroot army, as Kroot Carnivores/etc also have the Tau keyword. You'll want to build your army in a Battleforged fashion, and almost every detachment requires
HQ units.
When buying stuff, be aware that
GW generally charges more than online retailers or local stores. Online stores are limited to a 15% discount, while brick and mortar stores can have larger discounts.
GW's hobby supplies (paint, glue, brushes, tools) are especially overpriced. Any good gaming store will have cheaper, better options, though
GW paint is pretty good and reliably available everywhere. Stuff you'll need:
Small clippers for removing plastic from sprues (any hardware store)
X-Acto knife for trimming plastic and mold lines (a mold line removal tool works as well)
Plastic glue/cement for putting minis together (superglue variants also work, but plastic cement welds the plastic together), any hobby retailer sells it.
Hobby grit - for adding texture to bases. Optional, and there are many options for basing texture (tuft, flock, cork, etc).
Acrylic Primer - spray cans are the easiest, but brush primer is available too.
GW's primers are good but expensive, there are many cheaper options.
Paints -
GW paint is reliably available and my main reason for recommending it. Vajello and Reaper make better paints but can be harder to come by.
Varnish/Sealer - after painting, you seal the mini to prevent wear and/or chipping. Varnishes are available in matte, gloss or satin, and most players go for a satin finish.