If you are trying to breed cardinal tetras, use some peat moss and add it to a bucket/ container of distilled water, rain water or reverse osmosis water. Let the water go dark in colour then set up a 2 foot tank with the black water. Cardinal tetra eggs (and most other tetras) need very soft water to hatch. If the GH is above 10-20ppm, the eggs won't hatch so distilled or rain water (which has 0ppm GH) is best for breeding them.
You want the pH between 6.0 & 7.0.
Have a thin layer of sand or gravel on the bottom and add a clump of Java Moss or an artificial spawning mop. Add an established air operated sponge filter to keep the water clean and free of ammonia, and a heater if required to keep the water warm.
Have a coverglass for the tank to stop the fish jumping out.
Have the back and sides of the tank covered in dark card. Have a piece of dark card for the front too but don't put it on until after the adults have bred and been removed. The dark card on all sides is to stop light getting to the eggs, which as Andy said, the light harms the eggs and stops them hatching. Most tetra eggs are photosensitive. Do not have a light above the breeding tank either. Just room light.
The water in the holding tank should have the same pH and similar GH as the breeding tank but it doesn't need the blackwater tannins.
-----------------
Feed the adults 3-5 times a day for at least 2 (preferably 4) weeks before breeding them. This allows the fish to gain some weight and develop good quality gametes (eggs & sperm). Do big regular water changes and gravel cleaning when feeding more, so the tank stays clean.
Separate males and females for 5 days before breeding and then put 1 pair in the breeding tank. Add the female first and the male an hour later. This gives the female a chance to explore a bit and know where things are before the male is introduced. Try to add them in the afternoon and they usually breed the following morning. Sunlight can stimulate fish and get them going. Having the curtains open and putting the breeding tank somewhere so it gets morning sun will help. Leave them for 24-48 hours and then remove the adults. You should be able to tell when they have finished breeding because the female will be noticeably slimmer and the male will no longer be driving her towards the plants.
The adult fish can be fed while in the breeding tank but don't feed any live foods to the adults because they could harbor parasites like hydra that eat baby fish. You should also check the plants for hydra before adding them. Hydra are small freshwater anemone type creatures that eat baby fish.
After they have bred, remove the adult fish and put the card over the front of the tank. Leave it covered and in the dark until you see babies hanging from the side of the glass. The babies are small slim and see through. They take a few days to hatch and then hang on the sides of the tank for a few more days before becoming free swimming. You start feeding them when they start swimming. The following link has information on culturing food for baby fish and is worth a read if you don't know how to culture green water or infusoria.
After the parents have bred and before you cover the front of the tank, you can reduce the water level in the tank so it is 4-6 inches high. Make sure there is enough water for the filter and heater to work properly. This means there is less water for the baby fish to move around in when they first hatch and this means they won't have to swim as far to find food. As the babies grow, you can add a bit more water to slowly fill the tank and give them more room. During the first 2 weeks lots of baby fish starve because they can't find the food or it is too big for them. Having a lower water level and using green water and infusoria normally prevents this from happening.
https://www.aquariumadvice.com/forums/f82/back-to-basics-when-breeding-fish-380381.html#post3578561