How do nonce and difficulty relate? Good morning,

I'm reading about Blockchain technology but I have a couple of questions about the nonce that I cannot find the answers for.  I'm hoping someone here will be able to answer them.

i)  In order to adjust for the level of computing power available, how is the difficulty of the nonce changed?  What is the mechanism that checks if this should happen and how?

ii) What is to stop a code-savvy miner from changing the difficulty of their generated nonce to something easy so that they are the ones to place the block in the blockchain and win the mined coins?

I'm finding this topic quite fascinating and so any help you guys can provide is always greatly appreciated.
The Nonce is not difficulty based, the hash of the block is difficulty based. First, the miner hashes the block and checks if the block is solved. If it is not then the Nonce is incremented. If the Nonce overflows (which it does frequently) then the extraNonce portion of the transaction is incremented changing the Merkle Root and the block hash again, so the miner continues and again cycle the Nonce value.

There is some information here.

There is nothing stopping a miner changing locally the difficulty of the block it's mining, but such block simply won't be accepted by the other Bitcoin nodes.