This should be easy, especially for authors, but you would just not believe how many authors I work with who get this one wrong.
Books have a foreword. Things or people move forward (to the front), are forward (bold or brash), or are forward-thinking (progressive).
Foreword is actually a combination of the word fore, as in before or in front of, and the suffix -ward, meaning in the direction of. So, foreword literally means “before the word.” Hence, the foreword of a book a section or introduction before the main words of a book.
Forward is a direction. (And, by the way, it is always forward, never forwards. You have only one frontal direction just as you have only one backward direction.)
An easy way to remember which word to use, just remember that books have words and foreword ends in word.