HOW DO I KNOW IF I AM SAFE?

I have an irregular period, because I am anemic. I tried using different <a href="https://play.google.com/store/apps/details?id=com.glow.android.eve">period tracker</a>, but I cant be so sure, always.

The longest cycle I had was 6 months without period. But I know that I am not pregnant tho, coz first I dont have a boyfriend back then. The recent was 2 months without period.

I just had sex recently with my SO.