There are different types of peas, snow peas, snap peas, and the old standard green peas. That’s important on how you harvest them but not so important on how they grow. Some pea varieties of all of these are “bush” type. They grow to a limited height so really don’t need supports, but that does make them easier to harvest and easier to keep the weeds and grass out. The “pole” types do need support. Otherwise they will sprawl all over, making a total mess. The pea pods can rot if in contact with wet ground too. If you have the seed packet it should tell you what kind you have.
Beans are the same way. You can have beans intended for green beans, beans meant to be used only as dried beans, or beans that can be used both ways. Some of those are bush beans and some pole beans. You even get some called half-runners. The bush beans do not need to be supported, the pole beans really do, and the half-runners don’t absolutely have to be but they should. Again the seed packet should tell you which you have.
There are all kinds of different ways to support them. I have a fence around my garden so I plant my pole beans along that fence. Works great but occasionally the deer will munch on the ones outside the fence. It’s not that bad here. I bought cow panels, 16 feet long and just over 4 feet high, cut off a bottom horizontal so I was left with spikes, drove some T-posts into the ground and tied the cow panel to that for support for my snap peas. My Little Midgets green peas are bush so I don’t support them. I don’t support my bush beans either.
Some people set two posts at the ends of the rows and string fencing between them. I’ve done that before. Dad would take some tree limbs about 5 or 6 feet high and just push them into the ground deep enough so they would be self-supporting. The beans or peas would climb up those. If you have some stakes maybe 5 to 6 feet high you can stick them in the ground and run string from the top down to form a Teepee type structure. It can help in the wind to stake some of those strings at different angles to keep them from blowing over.
Sometimes you have to guide the beans or peas to start climbing. Once they start they do OK on their own. I use string or strips torn from an old T-shirt to tie them up to get them started when I need to or just weave them into the fencing.