You shouldn’t do this as this is one of the steps of Satan. You can use example of others such as the companions and the scholars but don’t ever talk about your own good deeds and leave them between Allah and yourself.

When my friends come to me for help in religios matters (Alhumdulillah), at times I tell them to do a particular good deed, like praying Tahajjud or reciting a lot of durood and that I do it too. I tell them so that they may be encouraged because if I can do it, then why not they themselves… I do take a lot of care not to fall for riyaa, is what I do correct and how should I take care not to fall into riyaa in this case?

Character and Morals |