D&D: The Worth of Steel
There are two kinds of rest, in terms of game mechanics. You can take a rest any time your character is inactive for a period, provided you are not unconscious (you can sleep but you cannot be knocked out) and not engaged in strenuous activity (you cannot be moving any significant distance, unless you are a passenger in a vehicle). For the purposes of resting, casting spells counts as strenuous activity.
A short rest takes minimum 1 hour- enough time to get off your feet, have a drink of water and a bit of food, straighten your armour, tend your wounds and mentally ready yourself for what lies ahead. Some powers recharge after a short rest, and you may spend Hit Dice to regain HP during this time.
A long rest takes at least 8 hours, at most two of which may be light activity such as reading, cooking a meal, or standing watch. If this rest is interrupted by any strenuous activity, there is no benefit, although you may begin another long rest immediately after. At the end of a long rest, a character recharges all their powers, regains all lost hit points, and half their total number of Hit Dice. A character cannot benefit from more than one long rest per 24 hours.
Advantage and Disadvantage
Sometimes you will be making rolls that have "advantage" and "disadvantage". To make a roll with advantage, roll 2d20 and use the higher result. To make a roll with disadvantage, roll 2d20 and use the lower result. Having both disadvantage and advantage on a roll cancels out both effects, and additional sources of advantage or disadvantage do not stack.
Advantage and disadvantage have no additional effects. For example, an attack roll made with advantage doesn't increase damage dealt unless a critical hit is rolled.