BPDU guard: Spanning tree works by sending BPDUs to communicate - figure out which switch should be the root, determine any loops in the network. When BPDU guard is enabled on a port, and that port receives a BPDU (which it shouldn't. Typically you enbale BPDU guard on portfast ports i.e. ports connected to a host) BPDU guard will then shut down the port and put it in err-disabled mode.
Root guard: The root is elected based on the priority. Lowest priority wins. Suppose you have a network and you have the appropriate switch elected as root. Now there is not stopping a switch being plugged in with a lower priority and becoming the root. Root guard is enabled for this purpose. Again, it is done on a per-port basis. Basically, when you enable root guard on a port, it stops any switch plugged into that port from becoming the root and shuts down that port if it tries to.
switch has BPDU Guard on port X: "I don't want to receive any BPDUs on port X. If I see any, I'll put port X in errdisabled state"
switch has Root Guard on ports X and Y: "I don't want to elect another root bridge. If I see better BPDUs on one of these ports, I'll put it into root-inconsistent STP state."