Toe nail is loose and toe isnt healing 🤢

Sa

So on Wednesday I hit my toe on the door and my entire toenail was lifted, but it is still attached at the, I guess you would call it, root or base of the nail. It bled and hurt. I pushed the nail down and put some gauze on it and it has stayed down since then. I have been cleaning it every day and doctoring it and keeping it covered in either bandaids or gauze, just waiting for everything to dry up and the nail to inevitably fall off. But it is still seeping blood, is swollen, and hurts when I walk on it or have my foot down. When I was cleaning it and changing my bandages this afternoon I saw that there is now yellow stuff coming out of the sides of my nail and the top. Is it infected? Should I go to the doctor? It is really bothering me. I thought I could handle it on my own but seems like I'm not doing something right.