Alright, so here's what you're going to do. Go on
genesisgen on github, download genesis.c and build it. Once you have the executable, run
name.exe <pubkey> <timestamp> <nBits>.
In <pubkey> you should add your public key in uncompressed format. In <timestamp> your message. In <nBits> the target. Leave it on 486604799 (1d00ffff) which is the lowest you can have with a difficulty of 1.
Once you mine the genesis block, the program will return you the coinbase script, the scriptPubKey, the merkle hash, the byteswapped merkle hash, the unix time and finally the genesis block's hash.
1. Change the genesisOutputScript to your scriptPubKey from
#L54.
2. Change genesis.hashMerkleRoot to the byteswapped merkle hash in
#L114.
3. Change consensus.hashGenesisBlock to your block's hash in
#L113.
4. Change the first two values from the CreateGenesisBlock function to the unix time and nonce respectively in
#L111.
5. Build Bitcoin Core.
I've made a tutorial here:
How to create your own altcoin (v0.20.1). It should be the same for the latest version of Bitcoin Core.