This tutorial is for wired keyboards those powered by QMK Firmware.
Regarding Bluetooth keyboards, powered by ZMK Firmware, please check this out: ZMK Keyboard User Guide #Flashing
If you are not sure about this, please contact the distributor/manufacturer/maker of your keyboard first.
In order to flash a firmware to your keyboard, you need:
(sound reasonable, right?)
Should be a file with .hex or .bin suffix (for example: kiwikey_kawii9_via.hex)
Regarding products of KiwiKey, please go to Download section.
It is a software that upload the firmware file into keyboard.
Download: https://github.com/qmk/qmk_toolbox/releases
Tip: QMK.Toolbox.pkg is for Mac OS, qmk_toolbox_install.exe is for Windows

The keyboard must run into a special mode to be flashed, called “DFU” or “Bootloader” mode.
There are several ways to do so, if you are not sure what to do, try one of the following ways:
If you have tried all and end up with no result, time to ask for help.
If everything goes fine, there will be a message in QMK Toolbox, says something is “connected”:

Click the Flash button in QMK Toolbox, some miracle lines appear, just let the magic do its work.
If you can see these “Success” texts in QMK Toolbox, everything is good:

Warning: do not unplug your keyboard during flashing, or it can be bricked (could be fixed, but tricky and need some special tools).
Test some basic functions (typing, LED lighting,…). Please note that there are keyboards with several versions/revisions, make sure the firmware version match the PCB version.
Tips: