You can refer to the instructions provided in the following documentation to protect a Simulink model:
https://www.mathworks.com/help/rtw/ug/create-a-protected-model-using-the-model-block-context-menu.html
Note: You must have a Simulink Coder license in order to create a protected model.