A man once came to Imam Abu Hanifah (rahimahullah) and said that he had buried some gold coins in his house. Now he had forgotten where they were.
He asked the Imam to reveal their hiding place. The Imam told him that this was no Islamic problem and how could he inform him on this matter. The man insisted and the Imam eventually told him to go and read Salaah (prayer) the entire night.
Not knowing how this could help, the man nevertheless did as told. The next day he came in joy to the Imam and said that after only two rakaats of prayer he had remembered where the coins were buried. He asked the Imam how did he come upon this as a solution?
The Imam said that the closest a man is to Allah is in prayer. So, the devil, realising the man would be the entire night in closeness to his Lord, decided to rather inform him of the gold’s location and turn him away from his prayer.
Foil the devil and become close to your Lord.