There are 2 sides to crop rotation, so it depends.
If you rotate crops you avoid the build up of pests, but peas followed by green beans shouldn’t present too much of a problem.
The other is to maximise the use of compost or manure you add to the soil, so the typical rotation pattern says plant heavy feeders straight after manuring and work through your rotation so you plant less heavy feeders or crops that don’t want lumps of manure in the soil like carrots last. Carrots will grow in freshly manured soil but fork if they hit a lump.
If you reread what you have seen on rotation with those 2 things in mind and with an idea of what you plan to do e.g are you going to dig stuff in on just a quarter of the plot, mulch, use raised beds or whatever, you’ll get an idea of what works for you