How it works
A resistor turns electrical power into heat. If it dissipates more than its rating it overheats, drifts in value and can fail or burn.
Common practice is to choose a rating at least twice the calculated dissipation, which keeps the resistor cooler and longer-lived, especially in enclosures without airflow.
P = V² / R or P = I² × R
Rating ≥ 2 × PWorked example
12 V across a 470 Ω resistor dissipates 12² / 470 = 0.306 W. With a 2× margin you need at least 0.61 W, so choose a 1 W resistor; a 1/4 W part would overheat.