Since it is a new tank adding some beneficial bacteria like safestart would be good then letting it sit for at least two weeks without adding anything else. Take it for testing by a local aquarium shop and if it's all clear then add some fish. It sounds like the tank was not fully cycled unfortunately. Best of luck man don't let it get you too down, everyone has to learn somehow.
Since it is a new tank adding some beneficial bacteria like safestart would be good then letting it sit for at least two weeks without adding anything else. Take it for testing by a local aquarium shop and if it's all clear then add some fish. It sounds like the tank was not fully cycled unfortunately. Best of luck man don't let it get you too down, everyone has to learn somehow.