Tā bǎ yìshēng xiàn gěi le kēxué, yòng zìjǐ de fāngshì bàoguó.
He devoted his whole life to science, serving his country in his own way.
Tips
culture
The best-known phrase with it is 精忠报国 "serve the country with utmost loyalty", the words that, in the popular story, the mother of the Song general 岳飞 tattooed on his back. Older records give them as 尽忠报国.
usage
Formal and patriotic: 立志报国 "to resolve to serve one's country", 科技报国 "to serve the country through science and technology". The longer form is 报效祖国.