In 1995, Stanley introduced the chromatic symmetric functions. The study of chromatic symmetric functions of graphs inspired two main research directions. The first research direction is to prove the Stanley-Stembridge conjecture: if a poset is $(3+1)$-free, then the chromatic symmetric function of its incomparability graph is $e$-positive, i.e., a nonnegative linear combination of elementary symmetric functions. The second research direction is to determine whether two non-isomorphic trees can have the same chromatic symmetric function. In this talk, we present several modular relations between chromatic symmetric functions and apply them to show that the Stanley-Stembridge conjecture is true for several new families of graphs. Moreover, using the modular relations, we give an algorithm to write the chromatic symmetric functions of trees in terms of the chromatic symmetric functions of paths. (Joint work with Victor Wang and Stephanie van Willigenburg).