In Islamic teachings which I was brought up in, we are made to believe that everything that happens is in the Decree of God (Allah). There is a hadith (sacred text from the Prophet) which says that among the first things God created was the Pen and then He told the Pen to write everything that would happen from that moment till the Last Day.
When we question as to how human beings can have free will and then be held accountable for our actions if everything is in the Decree of God then we have been told this answer cannot be reached by our limited human understanding.
But recently I saw the movie, "The Arrival", where the aliens have a non-linear perception of time. So if an Omnipotent Being can somehow have such a perception of time where the past, present and future can all be seen in one instant then can this somehow answer this question. Something to the effect of God only Decreed for you what He knew you would choose to do?