It's not really possible to write a consolidated handbook for 40K, since each army has its own book/codex, and they each play quite diferently.
But here's a "40K for newbies" intro if you don't know much about the game yet:
-The basic core of the game is two armies facing each other. Altough killing everything on the enemy's side will win you the match, you need to take in acount that a)there's usually other victory conditions like holding certain points of the map or simply making it to the other side and b)There's a limited number of turns, usually random, which means fully wiping out the enemy is actualy quite hard inside this time frame.
It's quite possible to have phyrric victories where your force suffered much more losses, but you're the one holding the objective in the end, or at least forcing draws by throwing your troops at objectives your oponent has whitout any hopes of actualy taking them, but still contesting them (if there's both enemy and allied troops in an objective, no matter the force disparity between them, it counts for no one).
-Victory conditions are usually decided at random by rolling d6. Then you can choose to deploy on the board and start first or deploy and starting second. Notice deploying first is a disadvantage as your oponent can then positions his units to counter your positioning more easily. Starting first however is a big advantage because you get to unload your heavy artillery in the enemy first, hopefully doing some serious damage. Some army leaders get to atempt to "steal the iniative", which allows them to deploy second and then start first anyway.
-Pretty much everything is decided by rolls of 1d6. Usually you roll to see if you hit an attack, then roll to wound/penetrate, then roll armor saves/vehicle damage charts. You roll a 1d6 for running, roll a 1d6 for dangerous terrain tests (nothing says 40K like your millenia-old god-king tripping over a wreck and breaking his neck). The exception are "mental" tests like morale, psyker powers, panic and giving orders, which are solved with 2d6. There's also the scatter dice, which randomize where area attacks and deep-striking units fall. Honorary mention for template attacks(usually flamers), that, exceptionally, auto-hit the enemy of your choice whitout any randomization, which makes them awesome even if they're quite short ranged.
-Armies are built with acertain amount of points, which you use to purchase units and upgrades from the army's codex. Each unit falls under the classification of "Headquarters, Elite, Fast Attack, Troops, Heavy Suport". You need to adhere to the "Force Organization Chart", which puts a limit to how much of each you can take (2 HQ, 3 elites, 3 FA, 6 troops, 3 HS), suposedly to enforce variety instead of just spamming the most optimal unit the codex has to offer. You also need a minimum 1 HQ and 2 troops. Notice that, barring exceptions only troops may claim objectives, altough other units can contest them, so you want at least 3 troops anyway.
-Units come under two main types, vehicles and everything else. Vehicles have Armor values for each of their facing, no leadership, their own movement rules, and their own damage chart table. Everything else has melee skill, ranged skill, Strenght, toughness, Wounds (aka HP, usually 1 except for heros, some brute units and monstruous creatures), Iniative, Attacks, Armor Save and Leadership and the same base speed of 6 inches. Monstruous creatures share the same stats as normal infantry altough they benefit from some extra rules like ignoring armor and dealing extra damage to vehicles, on top of having higher Strenght and Toughness. Scores of 3 are considered "average" for a normal human trooper, except for Leadership which is usally 7 (as it is tested in a 2d6, remember), Wounds and Attacks (which are usually 1) and Armor saves (which are kinda diferent. No score can ever go over 10, except for armor saves which can never go below 2+.
-Now each stat works in slightly diferent ways, but you usually want them to be high and roll high. For mental tests you want to roll low as you need to score under your leadership score to suceed (double 1s auto-pass), and for armor saves, the smaller the better, since you need to roll over your score to suceed. So 2+ termie armor works 5/6 of the time, while crappy 6+ ork armor only works 1/6 of the time.
-Guns have their own rate of fire, Strenght, and Armor Piercing. It's worth noting that either guns automatically pierce armor (if their AP is equal or lower than the armor) or they can bounce off. Most weapons in the game are AP 5 or better, so 5+ armor is rightly called paper armor. AP 1 also deals extra damage against vehicles. On the other hand, if you're standing behind obstacles, you may take a cover save instead of an armor save against shooting. How a little folliage can stop lazers able to melt trough adamantine and rocket launchers, we'll never know. Template weapons ignore cover, but usually if you're close enough to use them, the enemy is close enough to charge you in melee.
-Ah, melee in 40K. Even with all the high-tech ranged weaponry, jumping at your enemy and bashing away with pointy sticks can be quite effective! That's mostly because of a series of retarded rules to make melee viable
a)Altough tecnically cover also grants some protection from melee, it's easily ignored by cheap(if not free) assault grenades.
b)It's much more easy to increase your number of melee attacks than ranged attacks. While your suposed rapid-fire weapons are only shooting once a turn until the enemy is really close, your typical melee dude will easily lash out with three attacks once they close the distance.
c)Once you're locked in melee, not only you're unable to use ranged weapons (altough pistols can be used to club your enemy), you cannot voluntarily atempt to get out (unless you have a special rule for that). If you're beaten and panic, the troops will atempt to flee, but then your enemy gets an atempt to wipe them out in one go as they run, and even if they don't get them, your unit may just run out of the board and count as a casuality anyway.
d)Neither can uneganged ranged troops atempt to shoot in a group locked in melee. Yes, it doesn't matter if that's the enemy leader and his honor guard, and he's beating in completely expendable troops of your own side, and fluff-wise both your forces are a bunch of psycopaths, you're still not allowed to nuke them at the cost of friendly fire.
e)Finally, altough ranged weapons can be quite nasty, melee weapons are usually nastier. Power weapons automatically ignore all armor, power fists/klaws ignore both armor and double your strenght, and they're relatively cheap.
So, stay in cover, and shoot melee enemies on sight unless you have the mobility to keep away from them (easier said than done).
-Pretty much all of the above can be found in the 40K "core" book that has all the rules the armies share, including universal special rules that are tied to a key word (altough each codex inevitably makes up some special rules of their own).
-So your usual match goes something like "player going second deploys in cover, first player shoots things down, both armies aproach the center to claim objectives, end up locked in nelee or shooting each other's face at point-blank range". Sometimes, it may be worth it to charge an enemy with your ranged specialist just to lock their best ranged weapons.
-Deep-striking is one of the most infamous abilities of 40K, where troops burrow/teleport/fall from space anywhere into the battlefield. Is, however, also quite risky, since not only they arrive in a random turn, they'll usually scatter, being automatically wiped out if they touch any enemy unit (or they may just die instantly if you're unlucky enough). Drop pods, homing beacons and some other fancy choices make deep striking safer, but then points costs start to increase significantly. I've still seen players lose because they heavily invested in a deep-striking unit that ended up only arriving by the end of the game, when most of the rest of their army had already been defeated.
-Now that we've covered the gameplay basics, one must be pointed to keeping things cost-efficient. Giving every possible upgrade to your leader, then giving him a squad of pimped bodyguards and a pimped tank to serve as their transport may look look, but won't be very efficient. Usually you'll want to specialize units for a job. Give them the tools for said job and nothing else. On the other hand, it's allright to deviate a little for cheap all-purpose upgrades. A SM tactical squad is a ranged unit no matter how you look at it, but if you give the sergeant a power fist, it's a small points investment, and suddenly the squad is a viable threat to heavy units that get too close or an enemy hero that atempts to charge them alone.
-Always give an invulnerable save to your heroes. They may be used as armor saves, usually with a worst sucess chance but they can work against everything.
-Despite the setting, there's such thing as overkill. A heavy bolter has the same chance of killing a guardsmen as a lascannon, but the lascannon is not only costlier but also fires slower. You'll want lots of attacks for dealing with infantry, and high strenght attacks to deal with vehicles and monstruous creatures.
-Plasma guns are awesome for high Str, being rapid-fire and AP 2, for usually a cheap cost.
-Melta guns are also awesome for being cheap with even higher Str and AP 1, even if they're somewhat shor ranged, making them better at vehicle hunters, but work just fine for frying heavy infantry if they get too close.
-As of the last edition, transports have got quite better. Cheap, reliable, expect to see several of them in most armies. Thus anti-tank of some sorts, either in a mobile unit or with big range, is completely essential.
-Space Marines are the poster boys for 40K. While all other armies get 1 codex, space marines have currently five (not counting chaos marines)! Ok, you tecnically can't share anything between them, but still, it means expect to see a lot of marines-equivalent, aka dudes with 4 on most of their stats and Armor 3+, armed with bolters (also Strenght 4, AP5).
-The current edition is 5e, but some armies are still using codexes from older editions. Meanwhile 6e rumors have started circulating. The core rules may change yet this year!
And that's it at the top of my head. Hope it helped!