How to ban this type of URL in robots.txt (xyz.example.com)

When I visit our website: example.com, we get a lot of index results like
xyz.example.com, xyz.example.com/abe, xyz.example.com/abcds.

So I want to know how to ban these types of URLs on serp