There exist efficient programs for bringing a diagonalizable matrix to diagonal form by a similarity transformation. In theory of congruence transformations, unitoid matrices are analogs of diagonalizable matrices. However, excepting Hermitian and, more generally, normal matrices, there are no recognized programs for bringing a unitoid matrix to diagonal form by a congruence transformation. We propose an algorithm that is able to perform this task for a special class of unitoid matrices, namely, nonsingular matrices whose cosquares are well-conditioned with respect to the complete eigenproblem. Examples are presented to illustrate the performance of the algorithm.