Code-switching is the practice of alternating between two or more languages or dialects within a conversation or discourse, often reflecting social or cultural dynamics. It serves as a tool for identity negotiation, social positioning, and adaptation to different linguistic environments.