The easiest thing to do of course is simply take it to a bike shop. You'll get the correct part and the gears set up and adjusted properly.
If you want to obtain a replacement yourself, you can order a replacement Tourney TX from an online bike components store, however, there are several variations of Tourney derailleurs available you need to take account of.
Schwinn does not seem to list any info for the Ranger 24" model but looking at some online retailers that are offering it, it's a 7 speed, uses a direct derailleur mount and seems to have a medium cage length.
Target.com lists a Ranger 24" here: https://www.target.com/p/schwinn-boys-ranger-24-mountain-bike-black-red/-/A-50676983. That bike seems to have a Tourney TX35D model derailleur.
You'll want to check that the bike at Target looks like yours as it may not be the exactly same as what you have.
Niagara Cycle has a good selection of Tourney TX derailleurs available (and TY, which appears to be a slight upgrade). You should be able to find something that matches the mount style (hanger or direct), number of speeds (I'm fairly sure all Tourneys are 6 or 7 speeds) and cage length that you need. If you are not in the UK, Canada or Australia you should be able to find the correct model on Amazon.com or another online retailer.