When shall I have sex to get pregnant

My cycle length is 30 to 31 days average n my periods started on 14th may 2021 n had spoting from 10th May from 26th May to 2nd june Om my other app and it’s showing different on all apps when shall i do sex for getting pregnant I am really confused