While accessible,
GW's main games are still rather confusing.
Follow these steps:
1) Download the basic free rules here:
https://www.games-workshop.com/en-US/Battle-Primer-2017-ENG
2) The full and proper rulebook is available in the "full" starter set: Dark Imperium. ($160) You can find this rulebook for $35-40 on eBay.
3) There are two cheaper starter sets which do not contain the full rulebook; Know no Fear, and First Strike. Both of these would allow you play a small game.
Once you've tackled some of the rules, you'll need to figure out what army you're interested in playing. All armies have an army list you'll need to play. Initially these were released in sets of "Indexes" --- a temporary list while we waited for armies to receive their own Codexes.
Some armies have received Codexes, and some are still waiting. If your army as a codex, buy that (note: this contains special rules for that army, but does not include rules for playing the game). If your army does not have a Codex yet, buy the appropriate Index (Example: "Xenos 1" Index contains rules for Eldar, Dark Eldar, Necrons, etc.).
At the end of the day, in order to play a normal game of
40K you'll want the "Big Rule Book" (
BRB) from the Dark Imperium box, and a Codex for your army of choice. Beyond that you'll need a bunch of
D6 dice and a tape measure (and of course models/table).