All objects, no matter what temperature, emit and absorb infrared radiation, however a hotter object will emit more infrared radiation in a given time, compared with a cooler object.
Both the wavelength and the intensity of radiation depend on the temperature of the object. Very hot objects emit shorter wavelength radiation than cooler objects. As the object gets hotter in the graph below, it emits more short wavelength radiation, which is why very hot objects produce visible light e.g. a piece of very hot metal. The intensity of the radiation also increases at higher temperatures
A perfect black body absorbs all of the radiation incident on it. No radiation is reflected and no radiation is transmitted (i.e. passed through). A perfect black body is also the best possible emitter of radiation.
If an object is warmer than its surroundings, it will emit more radiation than it absorbs and its temperature will decrease. However, if an object is cooler than its surroundings, then it will absorb more radiation than it emits. This will cause its temperature to increase
If an object is at a constant temperature, then it is absorbing radiation at the same rate as it is emitting radiation
Absorbing or emitting radiation are the only ways that the Earth can gain or lose energy. The Sun emits short wavelength radiation such as visible light and ultraviolet. This radiation travels to the Earth. Some of that radiation is simply reflected e.g. by clouds. The remaining radiation can then be absorbed by the surface of the earth. This causes the temperature of the Earth to increase. The Earth now emits infrared radiation back into space
Some of the energy of the infrared emitted by the Earth is trapped by greenhouse gases in the atmosphere e.g. carbon dioxide. Human activity is increasing the levels of greenhouse gases, meaning that more heat energy is trapped in the atmosphere and less is radiated into space
Many factors can affect how much energy is radiated from the Earth e.g. the amount of cloud cover. Cloudy nights tend to be warmer than clear nights due to the reflection of infrared radiation back to the Earth and the prevention of infrared radiation being radiated into space.