"Better the devil you know than the one you don't" is an idiom that suggests it is better to stick with what is familiar and known, even if it is imperfect or unpleasant, rather than taking a risk on the unknown, which may turn out to be even worse.
It implies choosing a familiar or unpleasant situation over an uncertain one, as the consequences of the latter may be potentially more undesirable than what one already knows.