For tabletop games, Killteam is probably going to be your best starting point, pick a faction box. Its starts you off with a squad, and if you like that then you can start buying the actual army kits for the faction and graduate to full 40k.
The basic rules are free to download online, but to play an army you will need a codex, your army, and Chapter Approved 2018.
If you want to play video games, I recommend Space Marine which you can get pretty cheap on steam, its an action adventure game and is considered one of the best 40k game. Battlefleet Gothic Armada 1 and 2 are great 40k Naval fleet simulator. If you like diablo clones, Inquisitor Martyr is decent. If you like squad based survival (like left for dead) then Space Hulk Deathwing. If you like old school RTS's Dawn of War 1 with all the expansions is good, Dawn of War 2 is more squad based RTS and is a little divisive but still pretty good. If you like Xcom like games, the get Mechanicus.