It is given that element X has a valency of 3.
Formula for chloride of element X:

Formula: MCl3
Thus, the formula for chloride of element X is MCl3 .
Formula for sulphide of element X:

Formula: M2S3
Thus, the formula for sulphide of element X is M2S3 .