Depending on the type of bed you have, how much space and how much you are willing to spend/do there are many ways to do it.
For the simplest option, on Amazon you can buy bed guards that slot or clip or fit under the mattress that look like these.
I have seen many different styles of these and they all pretty much use a netting material but I have seen some that have striped material (like bars on a cot) but if the net look doesn't do it for you you can get some made of wood like actual cot sides like these.
They just sit under the mattress on the side/end of the bed so are easy to fit and remove but the net ones are easier to hide as you can fold them up. They also come at different heights and lengths to fit any bed so make sure to check dimensions to get something big and tall enough.
Another potential option if the netting style side is not a big deal for you is to use a rolling safety gate like this one.
These things have 2 parts the attach to a wall (or the side of a bed) that the roll clips into, they can then be stretched out and hooked onto another point and spring back into the roll when released. The bonus with these is again they come in several lengths (some quite long) and can be removed from the holder to hide if need be. Depending on your bed/position in room you might have to finagle some way to attach the holders but that shouldn't be too hard and if one gate isn't long enough for the bed side then you may be able to use 2 of them if you find a gate that can hook onto another gate.
These gates are also quite tall so they might feel more like a cot side.
Now on the more difficult but fun options, you could simply buy/make a cot side out of wood to your liking and on the upright bars at either end attach a metal hook/spike facing down, then on your bed have a corresponding metal loop that the hook can fit into. This allows you to simply slide a cot side into place and then lift it out when needed, the drawback is you still have a large cot side to stash somewhere but it is at least easy to fit/remove.
If you have a bed that stands high enough off the floor with space underneath the slats (i.e. no drawers under the bed etc.) something like this maybe.
Then try looking at companies
Richelieu or any ironmonger/joinery/mechanical fitting companies.
What you will be looking for (and forgive me as I don't know the exact technical name but someone in those companies will be able to help you if you describe it) is a hinged sliding arm. It's basically a metal slide like you would find on a set of drawers but once it is slid out will hinge whatever is attached upwards.
The idea here would be to attach it under the bed and to the cot sides so that when you want them you slide them out from underneath and then lift it to make the side wall, (you'll need a way to keep it up though) and when you want it hidden simply fold it down and slide back under the bed.
Not a cheap option and would take some work to do it but easily the most discreet and hideable way to have wooden cot sides.