If you have the time you could read the religions’ foundational texts (Bible for Christianity, Quran for Islam, etc.) before commentaries on them.
Considering many were written by or about grifters I would also not recommend them.
Of course, it helps to be familiar with scripture, but there's quite a bit of it and it's quite frankly not a particularly easy read (New Testament is a bit better than the Old). It's not where I would start – understanding the history of religion is more about history than religion.