To use these codes you type them into the dialer keypad. You should not need to press the call button.
However, some manufactures disable some of the codes. And if you bought your phone through a service provider they may also have removed some of them from the ROM, so if your experience is different from another user of the same phone that might be the reason. If the code is not supported by the phone software you are out of luck.
To give you an example, my Galaxy s21 supports the *#06# code, which will show the IMEI and serial number. But the *#*#4636#*#* code, to access the "testing" menu, does not work. So this is a case of a manufacturer removing one of the standard codes from its handsets (in my case a non-carrier UK model, which are generally far less locked-down than US carrier models).