When to use one
Use a 301 whenever a URL changes for good: a redesign with a new URL structure, a platform migration, merging two thin pages into one, moving from http to https, or changing domains. A 302 is the temporary equivalent and tells search engines to keep the old URL indexed. A 308 is a permanent redirect that preserves the request method and is treated much like a 301 for SEO.
Each old URL should redirect in a single hop to its closest equivalent, not to the homepage. Chains (A to B to C) slow pages down and can leak signals.
If a page is being retired with no replacement, a 410 (gone) or a well-designed 404 page is more honest than redirecting to something unrelated. Search engines treat irrelevant redirects as soft 404s anyway, so they gain you nothing.