X-Plane simulates ice accumulation on your aircraft that will affect your performance greatly. X-Plane also simulates a wide variety of systems that can prevent the accumulation of ice on various surfaces (anti-ice), or get rid off ice that has accumulated (de-ice).

Ice accretion

X-Plane simulates ice accretion at the following points of your aircraft: Wing, Propeller, engine inlet, pitot probe, static port, AOA sensor and cockpit windows. Wing ice affects both the weight of your aircraft, but also the amount of lift and drag generated by the wing, the L/D with respect to the AOA, and the critical AOA. In other words, an iced wing makes you heavier, requires a higher AOA to produce the same lift, generates more drag at a given AOA, and stalls at a lower AOA than an ice-free wing. The combined effect of all these factors is what makes ice so dangerous.
Pitot and static ice affect the instruments in your cockpit and the systems depending on those instruments (autopilot), AOA sensor ice will affect both instruments and artificial stability systems. Engine inlet icing will choke your engine power output, and propeller icing will reduce the efficiency of converting your engine power into thrust. The cockpit window icing will affect the 2d panel outside view, but the dataref can be employed by designers to make their own artistic icing effects in 3d cockpits as well.

As of X-Plane 11.30, the following datarefs can be used to check for ice:

sim/flightmodel/failures/frm_ice - ice on the left wing
sim/flightmodel/failures/frm_ice2 - ice on the right wing
sim/flightmodel/failures/prop_ice_per_engine[] - ice on propellers 0-7
sim/flightmodel/failures/inlet_ice_per_engine[] - ice on intakes/inlets of engines 0-7
sim/flightmodel/failures/pitot_ice - ice on pitot probe, pilot side
sim/flightmodel/failures/pitot_ice2 - ice on pitot tube, copilot side
sim/flightmodel/failures/stat_ice - ice on static port, pilot side
sim/flightmodel/failures/stat_ice2 - ice on static port, copilot side
sim/flightmodel/failures/aoa_ice - ice on AOA sensor, pilot side
sim/flightmodel/failures/aoa_ice2 - ice on AOA sensor, copilot side
sim/flightmodel/failures/window_ice - ice on cockpit window, affecting your ability to look outside

Anti- and De-Ice systems

Electrically heated anti-ice

All probes and sensors in X-Plane can be electrically heated to get rid of ice or prevent ice accretion in the first place. The following datarefs turn on or off electric probe heats:

sim/cockpit2/ice/ice_window_heat_on
sim/cockpit2/ice/ice_pitot_heat_on_pilot
sim/cockpit2/ice/ice_pitot_heat_on_copilot
sim/cockpit2/ice/ice_static_heat_on_pilot
sim/cockpit2/ice/ice_static_heat_on_copilot
sim/cockpit2/ice/ice_AOA_heat_on
sim/cockpit2/ice/ice_AOA_heat_on_copilot

Note that all of these electric heaters have associated electric loads, which you can set in Plane Maker. This allows to assign them to different electrical busses, and sap amperage from the electrical system. They also have the associated failures and failure datarefs.

Then there exist electrically heated inlets, wing leading edges and electrically heated propellers. While electrically heated wings are not terribly common, this was conceptually the only form of wing anti-ice that was available up to X-Plane 11.30. The following datarefs control electrical heating:

sim/cockpit2/ice/ice_inlet_heat_on_per_engine[] - per engine 0-7
sim/cockpit2/ice/ice_prop_heat_on_per_engine[] - per propeller 0-7
sim/cockpit2/ice/ice_surfce_heat_on - both wings leading edge anti-ice
sim/cockpit2/ice/ice_surfce_heat_left_on - wing leading edge heat left side
sim/cockpit2/ice/ice_surfce_heat_right_on - wing leading edge heat right side 

All of these have associated electrical loads which can be set in Plane Maker to configure the amps consumed, and the ability to fail them.

While electric wing heating is not common, when none of the below mentioned new datarefs are used, X-Plane defaults to this electric heating for backward compatibility with plugin and aircraft predating X-Plane 11.30 which might be unprepared for the effect of bleed air consumption by a thermal anti-ice system.

Bleed air thermal anti-ice

Airliners typically use hot bleed air from the high pressure compressor section of the engine to de-ice the wing leading edges and engine intakes (wing and cowl anti-ice). Turning on these systems will increase the bleed air demand on the engine, thus reducing available power and volumetric efficiency, leading to lower thrust and higher EGT.

sim/cockpit2/ice/cowling_thermal_anti_ice_per_engine[] - engine TAI on engines 0-7
sim/cockpit2/ice/ice_surface_hot_bleed_air_on - wing thermal anti-ice each wing
sim/cockpit2/ice/ice_surface_hot_bleed_air_left_on - wing thermal anti-ice left wing
sim/cockpit2/ice/ice_surface_hot_bleed_air_right_on - wing thermal anti-ice right wing

Note that these use exactly the same electrical sources and failure datarefs as the electric anti-ice functions, so that the need for electricity to actuate the valves and valve failures are simulated.

Leading edge inflatable boot de-ice

An older type of de-icing system found on some bigger general aviation aircraft are inflatable rubber boots on the leading edges of the wing, stabilizer and sometimes rudder. They work with an electrical air compressor inflating the boots, which then break off the ice. Note that this system is not an anti-ice system, but purely a de-ice system, as the inflatable boots cannot prevent ice from accumulating, but only blast off ice that has accumulated to a certain thickness. The ice needs a certain thickness, otherwise it will not break off. Typically, the air pump is on a timing schedule that periodically inflates and deflates the boots when it is turned on.

The air pump can be controlled by these datarefs:

sim/cockpit2/ice/ice_surface_boot_on - inflatable de-ice boots schedule on, both wings
sim/cockpit2/ice/ice_surface_boot_left_on - inflatable de-ice boots schedule on, left wing
sim/cockpit2/ice/ice_surface_boot_right_on - inflatable de-ice boots schedule on, right wing

Compared to the electric, thermal, or fluid anti-ice systems, you will see that this system lets ice accumulate on the wing, and then blasts it off. Amperage will only be consumed from the assigned electrical system (the same sources and datarefs as the electric and thermal surface heat) when the compressor is actually running, so it will only generate amp spikes instead of a continuous load.

TKS fluid anti-ice

This type of chemical anti-ice system, also called the “weeping wing” is found on modern general aviation aircraft. To equip your aircraft with TKS anti-ice, go to the Special Equipment screen in Plane Maker, and enter a value for the TKS fluid reserve in liter. Note that a capacity of 30 liter or greater makes X-Plane assume the plane is FIKI equipped.
In the cockpit, the pump for the TKS anti-ice can be controlled by the following datarefs:

sim/cockpit2/ice/ice_surface_tks_on - weeping wing on, both wings
sim/cockpit2/ice/ice_surface_tks_left_on - weeping wing on, left wing
sim/cockpit2/ice/ice_surface_tks_right_on - weeping wing on, right wing
sim/cockpit2/ice/ice_prop_tks_on_per_engine[] - propeller TKS anti-ice on, engine 0-7

Note that each of these can be set to 0 = off, 1 = normal, and 2 = high setting. Note that the normal setting provides less anti-ice capability than a thermal anti-ice system, and might be overwhelmed by fast accumulating ice.

Fluid consumption is such that a 12 liter TKS tank can supply one prop and both wings with fluid continuously for 80 minutes in the normal and 45 minutes in the high setting. So use it wisely.
The fluid level can be checked with the dataref

sim/cockpit2/ice/ice_tks_fluid_liter