A complex form, split into 5 steps using the material design stepper, step 4 is optional. should this screen have a 'SKIP' button and a 'NEXT' button, or just a 'NEXT' button?
If step 1 have to be completed before step 2, and step 3 before 4 etc... Then: I will start from disabling 'NEXT' in 1, 2, 3 and 5 step. Once user complete the task 'NEXT' is unable. When user get to step 4, the 'NEXT' should be active whole time. It inform user that he/she can jump to next even if the user didn't completed the step 4. You shouldn't leave 'NEXT' active for steps that have to be completed, it is confusing.
Do you want your users to be able to go back and forth in wizard even when steps aren't completed? Then usually it is solve by a disclaimer "this step is not required". Although then should be some default settings for all steps, because you allowing user to basically skip it all. (Like when you install a program.)