You are trying to use "construction" grade timber as though it were planed timber (i.e "finished" timber), so it's possibly an inappropriate choice of material unless you don't mind the markings, I'm afraid. If you'd ordered PAR (planed all round) timber instead it wouldn't have had the grading and source, etc down the side.
One thing you might be able to do is try to orientate the timber so the markings are on the undersides or backs where they either cannot be seen or are at least less noticeable
These markings will sometimes sand out (with a belt sander) but the stain used so
can go 2 to 3mm deep into the timber. You can also try bleach (the two-pack type for wood, not Domestos) or a solution of oxallic acid crystals in water, but the dyes used to mark construction timber are meant to be durable in long term exterior storage around building sites, so neither is guaranteed to work.
If the item is already built possibly the only thing you can do is to seal the marks in with white French polish, patent knotting (brown) or a proprietary sealant such as Zinsser BIN and then paint it. You need to seal it in before painting as the purple dye the use can often bleed through paints unless sealed first. Same applies if you stain the timber where any solnvents in the coating can partially dissolve the marking dye.