The "4-to-1 rule" of ladder safety is that for every four feet up, you should move the base of the ladder one foot away from the wall.
Ladders that are not self-supporting should be leaned against a wall or attic opening when in use. The ideal angle for this is "as close to the pitch of 75 1/2 degrees from the horizontal," according to the American Ladder Institute (ALI).
For more information, please visit https://www.americanladderinstitute.org/page/Ladders101.