I am a beginner and doing CPU mining on my laptop. My question is, can I mine with XMRig and the Monero GUI at the same time?
Yes, you can mine with both at the same time, but you won't get any benefit.
XMRig is a dedicated, optimized miner, so as long as it's been configured correctly, it will give you the best hashrate for your system.
If you mine using both XMRig and the GUI on the same system at the same time, at best you'll get the same hashrate as just using XMRig, but more likely, your overall hashrate will be worse.