Hey Ali, how are you? I hope you are doing just fine!
I shall provide you with an explanation about the usage of this idiom in sentences:
* As a matter of fact (also known as AAMOF):
1) The meaning of the idiom concerned is the same as that of ''actually'' or ''in fact'' which is often used for emphasis. This is the meaning which is more commonly used by English speakers.
E.g.: ''As a matter of fact, I did remember to pick up dinner on the way home from work''.
E.g.: ''I have been learning English for almost a year now, and, as a matter of fact, I am quite proud of myself!''
2) This idiom can also be used to mean ''in addition to what has been said''; ''in reference to what has been said''.
E.g.: ''The other day John suddenly got home from work. As a matter of fact, he came into the room while we were talking about him''.
E.g.: ''I'm not a poor worker. As a matter of fact, I'm very efficient''.
3) When it comes to spoken English, the idiom ''as a matter of fact'' is frequently used when you are telling somebody something interesting, new or important.
E.g.: ''I’m going home early today. As a matter of fact, it’s my birthday''.
E.g.: ''I don’t agree, as a matter of fact''.
Hope that helps!!! :)