Cancer can be considered one of the most threatening diseases to human health, and immunotherapy, especially T‐cell immunotherapy, is the most promising treatment for cancers. Diet therapy is widely concerned in cancer because of its safety and fewer side effects. Many studies have shown that both the function of T cells and the progression of cancer can be affected by nutrients in the diet. In fact, it is challenging for T cells to infiltrate and eliminate cancer cells in tumor microenvironment, because of the harsh metabolic condition. The intake of different nutrients has a great influence on the proliferation, activation, differentiation and exhaustion of T cells. In this review, we summarize the effects of typical amino acids, lipids, carbohydrates and other nutritional factors on T cell functions and provide future perspectives for dietary treatment of cancer based on modifications of T cell functions.