The Num lock should always be enabled. If it is disabled when you are attempting an alt code, it may cause errors or unexpected results in some applications. For example, Alt+4 could be interpreted as Alt +, ← which causes the browser to go back if the Num lock is disabled.
If your laptop keyboard doesn’t have a separate NumPad, you should hold FN button with Alt button while typing the code.
This method does not work for Linux system, but it is possible to use Unicode.