the red bit is a disc spacer. with hydraulic brakes you should never squeeze the lever when you don’t have a disc in the brake (ie when you have your wheel off). otherwise the pistons can pop out of the calipers and it’s a ball ache to get them back in. so if you’re travelling somewhere with the wheel off (say you have the bike in the boot or whatever) you stick that red spacer into the brake caliper so that the pistons don’t accidentally pop out. worth keeping hold of but i’ve lost all mine and you can always use a penny or just about anything instead so not the end of the world.
the yellow one is a bleed block which is kinda the same thing but you use it when bleeding the brakes. which i doubt you’ll be doing any time soon.
(that’s what they look like anyway)