To make your character lovable, you have to make it natural and sincere. Sometimes some characters are lovable, even if they make bad decisions or do bad things. Because they are natural and reflect reality. In some cases this may change, but in general, characters that are natural and people can find something of themselves are more liked.