How to create 'compile_commands.json' file

So I am trying to get the ‘compile_commands.json’ file so I can use it inside of Sourcetrail.
I do understand that I have to specify the tool mode ‘GenerateClangDatabase’ but I don’t know how/where.
Am I supposed to add an argument to the build task in the ‘tasks.json’ file?

I found that in this answer that led me to it:

Additional: I am using VSCode on Windows 10