Karhedron wrote:The latest (8th edition) of the Rulebook is a decent place to start. It contains a brief history of the Imperium as well as a summary of the various races and factions in the
40K Universe. While it does not go into great depth, it does introduce pretty much everything in one place.
This. It really covers a wide range, as well as touches upon all the races and the key roles they've played in the overall narrative. And it's filled with beautiful art - I'd say at least half the book is art and background, if not more (so it's not a silly purchase if you don't care to play the game).
I also recommend a YouTube user Leutin09 who does some great
40K lore primer videos which, in my opinion, are some of the better written and narrated videos of their kind.
The first three Horus Heresy novels at least are pretty great, and a lot of people love the Gaunt's Ghosts series. Beyond that, other users can give you much better Black Library recommendations.
For getting started with the game, there's a number of different starter boxes at various price points - including individual board games, or sets that can be used as board games and wargames. It might actually be worth popping into your local
GW for a demo!