Transponder discipline is important. Never squawk a code you have not been assigned. Never experiment with codes. Never set a code associated with emergencies unless you are in an emergency. Always confirm the code assignment with ATC before setting it. Always leave your transponder on during flight, even in uncontrolled airspace with squawk 7000.
In crowded airspace, your transponder is often the primary tool that allows ATC to keep you separated from other traffic. If your transponder is not set correctly or is turned off, you become invisible to radar, and ATC cannot see you. This is dangerous and unprofessional.