I'll add only one thing to Ms. Morcroft's excellent answer: don't use a court-appointed attorney. Your child is the most important person in your world, and you can't risk losing her by using a lawyer you didn't choose. Find a good lawyer who knows dependency cases. That lawyer may cost a lot, but nothing is more important than your child.
The contents of this answer should be considered friendly advice, not legal advice (I'm a pretty friendly guy), and the answer should not be construed to constitute an attorney-client relationship. Also, if you liked this answer as much as my big ego thinks you did, be sure to click the thumbs-up button!
Fill out the paperwork at court and see if you qualify for a court appointed attorney. If not, get an attorney who is familiar with dependency cases. DO NOT explain to the judge what happened if you do not have an attorney there to consult with. If the attorney is not appointed and present at shelter and your child is sheltered, ask for a shelter review to be set when your attorney can be present. DO NOT talk to the police even if they tell you they are just trying to help. You may need a criminal lawyer, but either way, do NOT talk to the police. Also, the caseworker is not your friend in this matter, nor is she an attorney. DO NOT take legal advice from the caseworker. DO NOT rely on the case worker to explain the process to you. Get an attorney. Then listen to YOUR attorney. Shelters are often granted, so be prepared for that. You don't say how old your daughter is. People who don't have specific knowledge of what happened are of limited usefulness in regards to helping you with your case, but once you have a lawyer, you can discuss with your lawyer ways in which they may be able to help you.
***Please be sure to mark if you find the answer "helpful" or a "best" answer. Thank you! I hope this helps. ******