This sentence is correct. It conveys the idea that the speaker would not have become friends with the person in question if they had known how horrible they were.
This sentence is correct. It conveys the idea that the speaker would not have become friends with the person in question if they had known how horrible they were.