https://bbs.archlinux.org/viewtopic.php?id=276847
As AUR may be involved - for building a customised driver package - please acknowledge the unsupported nature of custom packages.
Install the headers for your active kernel
Kernel example - yours may be different
$ mhwd-kernel -li
Currently running: 6.18.0-1-MANJARO (linux618)
The following kernels are installed in your system:
* linux618
Note the line Currently running: 6.18.0-1-MANJARO (linux618)
Prepare by syncing the base-devel and linux618-headers
Yours may be different - adjust accordingly
sudo pacman -Syu base-devel linux618-headers
Build the driver
pamac build rtl88x2bu-dkms-git