How to Achieve Sincerity in Your Deeds in Islam
Question

The individual should keep his intention in mind and correct it before doing any deed; how can he do that? What are the standards and guidelines to know whether what you are doing is correct and sincerely for the sake of Allah alone?
Praise be to Allah.Correcting one’s intention 
Correcting one’s intention , and bearing it in mind when starting to do the deed, is one of the most important things a Muslim should focus on, for the acceptance or rejection of one’s deeds is based on that, as is the soundness or corruption of the heart.
The one who wants to form a sound intention for his deeds must pay attention to the motive that is prompting him to do that deed, and he should be keen to ensure that his motive is seeking the pleasure of Allah , may He be Exalted, and obeying Him and complying with His commands.
By doing that, his intention will be for Allah. After that, he must maintain this original motive for doing the deed that is sincerely for the sake of Allah. He should not be distracted from that whilst doing the deed, and ensure that his heart and his intention do not change, or become diverted to something other than Allah, or associate anything else with his intention.
How to achieve sincerity in your deeds
One can find out whether he is being sincere in his deed, and whether he is striving only for the sake of Allah, by paying attention to the following:

He should not do that deed so that other people can see him or hear about him .

Al-Bukhari (6499) and Muslim (2987) narrated that Jundub (may Allah be pleased with him) said: The Messenger of Allah (blessings and peace of Allah be upon him) said: “Whoever talks about his good deeds (to show off), Allah will expose him (on the Day of Resurrection), and whoever makes a (hypocritical) display, Allah will make a display of him.”
Ibn Hajar (may Allah have mercy on him) said:
“Al-Khattabi said: What this means is that whoever does a deed that is not sincere (for the sake of Allah), rather he wants people to see him and to hear about him, will be recompensed for that by Allah exposing and disgracing him, and will make known what he used to conceal.
And it was said: whoever intends by his deed to seek high status among people, and does not intend it for the sake of Allah, Allah will cause him to be talked about among those with whom he sought to attain high status, but there will be no reward for him in the hereafter." (Fath Al-Bari 11/336)
Al-‘Izz ibn ‘Abd As-Salam (may Allah have mercy on him) said:
“Exceptions from the recommendation to conceal one’s good deeds include: one who does his good deed openly so that his example may be followed, or so that people may benefit from it, such as writing books of knowledge." (Fath Al-Bari  11/337).

He should not concern himself with people’s praise or criticism.

Ibn Al-Qayyim (may Allah have mercy on him) said:
‘When a person reaches a high level of devotion to his Lord and becomes steadfast in that, he will rise above being concerned with people’s praise and criticism, and he will not rejoice when people praise him or be upset when they criticise him. This is the description of one who is not swayed by his whims and desires and has attained true servitude to his Lord, and whose heart has tasted the sweetness of faith and certainty." (Madarij As-Salikin  2/8)

Concealing his good deeds and keeping them secret should be dearer to him than doing them openly.

It was narrated that ‘Asim (may Allah have mercy on him) said: “When Abu Wa’il prayed in his house, he would sob greatly and he would not do that in a place where people could see him, even if he were to be offered the entire world in return for anyone seeing what he did.”
Narrated by Ahmad in Az-Zuhd (p. 290).

He should be keen to avoid situations where he could become prominent and famous, unless that serves a legitimate Shar`i interest.

Ibrahim ibn Adham (may Allah have mercy on him) said: “He is not sincere towards Allah who wants to become famous." (Ihya’ ‘Ulum Ad-Din  3/297).

He should not increase his good deeds and make them perform them in a better manner when people are around him.

It was said that sincerity means that a person’s deeds are the same whether they are done openly or privately.
Showing off occurs when the deeds one does openly are better than those that are done privately."(Madarij As-Salikin  2/91).

He should always think of himself as falling short, and should not attribute any good deeds to himself, and he should realise that all blessings come from Allah, and were it not for Allah, may He be Exalted, he would be doomed.

Allah, may He be exalted, says (interpretation of the meaning):
“And if not for the favour of Allah upon you and His mercy, not one of you would have been pure, ever, but Allah purifies whom He wills” [An-Nur 24:21]

He should pray a great deal for forgiveness (Istighfar ) after doing the deed, and should feel that he has fallen short.

As-Sa‘di (may Allah have mercy on him) said:
‘Every time a person finishes an act of worship, he should seek Allah’s forgiveness for his shortcomings, and thank Him for enabling him to do it. He should not be like one who thinks that he has perfected his acts of worship and done a favour to his Lord, and think that it has given him a high status, for such a person deserves rejected and for his deed not to be accepted, just as the former deserves to be accepted and enabled to do more deeds." (Tafsir As-Sa‘di  p. 92)

He should rejoice when Allah enables him to do righteous deeds.

Allah, may He be exalted, says (interpretation of the meaning):
“Say, in the bounty of Allah and in His mercy - in that let them rejoice; it is better than what they accumulate” [Yunus 10:58]
If a person pays attention to these matters with regard to his deeds, then there is the hope that he will be one of the sincere.
Can you be certain that you are sincere in your deeds?
As for being certain that one is sincere in his deeds, there is no way to verify that, because the knowledge of that is with Allah alone. But the individual should take measures to attain sincerity, and ask Allah, may He be Exalted, to enable him to do his deeds in an appropriate and sincere manner, but he should not affirm that he or anyone else has attained sincerity.
For more details, please see this category: Sincerity
And Allah knows best.