thyroid and hormonal test

is it necessary to do to thyroid or hormonal test before starting any weight loss program?