Einstein's pursuit of a unified field theory, also known as his quest for a theory of everything, was indeed a significant part of his later years. While the exact reasons for why he ultimately stopped working on it are not entirely clear-cut, there are several factors that likely contributed to his decision.
Challenges and complexity: Developing a unified field theory that could successfully unify all the fundamental forces of nature (such as gravity and electromagnetism) into a single framework proved to be an extremely difficult task. Einstein encountered numerous technical challenges and mathematical complexities along the way. As the years passed, it became increasingly apparent that finding a satisfactory solution was more elusive than he had initially anticipated.
Lack of progress: Despite dedicating considerable time and effort to the problem, Einstein was unable to make significant progress in formulating a successful unified field theory. The equations he proposed, such as the tensor-based field equations, did not yield the desired outcomes or provide a complete and consistent framework. Frustrated by the lack of breakthroughs, he gradually shifted his focus towards other areas of research.
Evolving interests: Einstein's interests and priorities evolved over time. In addition to his pursuit of a unified field theory, he also became involved in other scientific endeavors, such as advocating for quantum mechanics and working on the development of the general theory of relativity. These new interests may have diverted his attention and energy away from the unified field theory problem.
External developments: The scientific landscape was changing rapidly during Einstein's time, with the emergence of quantum mechanics and the growing body of experimental evidence supporting it. These developments presented new challenges and opportunities for understanding the fundamental nature of the universe. It is possible that Einstein's attention shifted towards exploring these new frontiers rather than solely focusing on a unified field theory.
Practical limitations: As Einstein grew older, he faced practical limitations that could have hindered his ability to continue working on complex theoretical problems. He faced health issues and encountered personal challenges, which may have affected his ability to dedicate extensive time and energy to the pursuit of a unified field theory.
It's important to note that while Einstein did not achieve his goal of a complete unified field theory, his contributions to physics, particularly with the theory of relativity, were groundbreaking and continue to shape our understanding of the universe today.