Learned borrowing from Latin fōrmālis. By surface analysis, forma + -al.
Practice speaking and memorizing "formal" and many other words and sentences in Portuguese.