I of course highly recommend taking him to the vet ASAP but if that's not an option or wont happen soon then read on.
It's difficult to be sure by your picture as the wire mesh is obstructing my view in your photo. Since lizards don't have testicles per say, it's most likely a case of a prolapsed hemipenes. This is not that uncommon and can occur more so during breeding season. Since most keep their collareds on a grainy sand substrate, the possibility of some sand attaching to an exposed hemipenes is likely. The folds of the cloaca usually clean off most of the sand or foreign matter as the hemipenes retracts and there's no problem most of the time.
I've had this occur with one of my uros during breeding season but was lucky enough to catch it soon after. If it goes untreated for any length of time the soft delicate tissue will lack blood flow and eventually dry up causing much more serious problems which may end up fatal. I had a collared (aquaflame) male who died from this problem as it went unnoticed for probably a week or more. By this time the tissue had dried and was colorless (lack of circulation) and it didn't take long after that to eventually loose him.
My suggestion is to get him in a warm soak where you can gently massage the area while his hind quarters are submerged and hopefully work some of the obstruction from the cloaca. If you see any signs of it retracting, then continue but with gentle action. If there's still some hemipenes exposed then dry him off then lubricate. KY is what we use at work but any antibiotic gel such as neosporin will help if that's all you have available.
Please take him off the sand for now. use paper towels for a temporary substrate while he's in therapy. If there's no change, repeat the soak/massage and lubrication once or twice a day and hopefully he'll be back to normal soon.
John