1 Samuel - Chapter 7
Samuel has some advice for the people:
"Then all the people of Israel turned back to the Lord. So Samuel said to all the Israelites, “If you are returning to the Lord with all your hearts, then rid yourselves of the foreign gods and the Ashtoreths and commit yourselves to the Lord and serve him only, and he will deliver you out of the hand of the Philistines.” So the Israelites put away their Baals and Ashtoreths, and served the Lord only."
The instruction to "serve only him" was said by Jesus during his temptations (described in Luke 4)
"The devil led him up to a high place and showed him in an instant all the kingdoms of the world. And he said to him, “I will give you all their authority and splendour; it has been given to me, and I can give it to anyone I want to. If you worship me, it will all be yours.” Jesus answered, “It is written: ‘Worship the Lord your God and serve him only.’"