Collision Domain

Thanku so much sir for your precious time and clear my point .
I want to know about how a switch negotiate to work in half duplex , if it work is they use CSMA CD or not ?
As i learn from somewhere switches uses single broadcast domain and separate collision domain for each port .
My question is they use same domain in both full duplex and half duplex .
How to check and configure half and full duplex in switch and router too ?
How to find that the device is half duplex or full duplex , is that happen on port configured ?

i want a brief explaination in this , hope you understand my query .

Regards
Shivam Chahal