It was narrated from 'Abdullah bin Sarjis that the Messenger of Allah ﷺ saw a man performing the two Rak’ah before the morning prayer while he himself was performing prayer. When he had finished praying he said to him: "Which of your two prayers did you intend to be counted (ie, accepted)?"
The Prophet's question also teaches us about being mindful in our actions and intentions, as well as being aware of what we are doing in order to ensure that it is done correctly and with sincerity so that it can be accepted by Allah. We should always strive to do good deeds with an intention for them to be accepted, rather than just going through the motions without any thought or purpose behind them.