troubled step daughter

my step daughter is 4 years old and has had a ruff road with her mom. Her mother has put her in bad situation of terrible boyfriends that locked her in her room all day not feeding her and getting injured and her own mother packing up and leaving her with my husband and I and never calling or coming back to see her. We recently started to have issues with her attitude and things she does. She rude to kids and my husband and I lies about things she has been caught red handed doing to peeing in her room 😖 I don't know what to do to help her and our family.