The infinite stats command allows you to rapidly gain stats back from health, stamina, oxygen, torpor, or melee damage. Unfortunately, it does not add to the weight, speed, or crafting skill. You are not invincible because (depending on your stats and armor) a fall off a cliff, or a bite from a Giga will instantly take your health down to 0 and you can't recover from 0. If you are in a fight, your armor will still lose durability.
To use the infinite stats command on PC, you need to be on single player or the admin of a server.. In single player hit the tab key, and type infinitestats and hit the enter key, and your done. If you have never used a cheat code before, you have to enter enablecheats first.
To bring up the admin command line on console you need to do the following in the pause menu
XBox One LB + RB + X + Y
PlayStation L1 + R1 + square + triangle