How do you determine which blood type is suitable to be donated or received in a blood transfusion?

How do you determine which blood type is suitable to be donated or received in a blood transfusion?