Logistic regression can be used to model categorical outcomes, such as whether a patient will live or die after being admitted to the hospital. It involves calculating the odds ratio of an event occurring compared to it not occurring, and taking the log of the odds ratio. This allows the relationship between independent variables and a binary dependent variable to be modeled.