Garden soil is generally not recommended for aquariums. It may contain chemicals, pesticides, and fertilizers that harm aquatic life, as well as bacteria, fungi, and invertebrates. Soil particles can cloud the water and clog filters.
Instead, use aquarium-specific substrates such as sand, gravel, or specialized plant substrates, which are inert and designed for underwater use.