If vibration causes nuts to constantly work loose, first add a lock washer, if it doesn't have one. Or, if there is room on the bolt, use two nuts, tightened toward each other so they lock solidly. You can also try wrapping monofilament fishing line under the nut before tightening it on the bolt. Another possibility is to try wrapping the threads first with the teflon tape that is used in plumbing.
When hooking up a trailer, instead of connecting the trailer’s safety chains directly to the hook in front of it on the vehicle, cross them. Put the chain from the right side of the tongue to the hook on the left side of the hitch. Likewise, put the other chain onto the hook on the right side of the hitch. That way, should the trailer come unhitched, the tongue and coupler will land on the crossed chains instead of skidding on the road.