My snail/aquarium people please help 🐠🐠🐟🐟🐌🐌🐌

So I have a beta fish in a 5 gallon tank . I had two mystery snails in it but they both died . Well

Come to find out one of the snails had babies .. I would say there’s close to 50 in there , maybe more . I never owned snails before and I don’t want them to die . Most of them are still really tiny . Any advice, please heellllp.