Task complexity refers to the degree of difficulty and the number of elements involved in a task, which can affect an individual's ability to focus and perform effectively. When tasks are complex, they may require more cognitive resources and greater attention to detail, influencing how people manage their attention when performing either selective or divided tasks. This relationship is crucial in understanding how individuals prioritize attention under varying cognitive loads.