Make sure the child knows that none of your moods is their fault. If they're mean to you it still isn't mean intentions. Children from bad homes do all kinds of things to try express their needs as they only know how to get attention by punishment/ negative attention. Just tell them in your home, they can feel safe to say what's on their mind and that you're there for them.
Tell them if they need anything , money, homework help, life advice or precisely anything , they can always ask. Tell them you aren't their biologic parent and you will never expect or force them to see you or call you mom/dad. Say you are their friend and support, whenever they need it.
Expect that they will test you. If you judge them by their behavior etc. They are used to be told they're not good enough and don't deserve love so you have to prove the opposite.
Remember they're just lost children.
Their behaviour or moods aren't about you either.
To be in foster care is terrifying and kids can react in all kinds of ways. Adapt. If they need space give space. If they need your attention pay attention. They might talk in passive agressive tone at first cause they are protecting themselves from getting hurt and from having a parent figure fail them again.
Give it time. Let them have their learning curve. And don't be too hard on yourself because it will be projected on everyone around you including the child.
You do your best they do their best
We all have flaws. There's always a new chance tomorrow.