There are hundreds of videos on YouTube on how to build a workbench, from inexpensive to incredibly expensive.
I like the one
Simple Sturdy Workbench Build because it is very sturdy and
does not require any special brackets.
(The secret is wood dowels !)
Most people will use 2x4 for the major structural parts. The problem is, most of what comes out of lumber yards is not sufficiently dried. Buy your material and store it inside raised off the floor for good air flow. Place heavy object on top to prevent warping. If you have it stacked more than 1 layer high, rotate the stack after a month. Wait at least 1 month for additional drying. 2-3 months would be better.
If you plan on making the top out of 2x4, after drying, cut about 1/8" off of each long edge so that it is square. Lay out the pieces so the growth rings alternate. Doweling is good, but not required
(Quick and dirty alternative to doweling. Get some ardox nails 2-1/2" -3" long. Pound a few about half way in one long edge of the boards to be glued up. Glue and clamp.) Spend some time with a sander and you will have an solid top that will last for years.
For deluxe finish, apply several coats of boiled linseed oil. This will take time (potentially weeks) but it will give you a stain resistant finish.