Seatposts
The function of the seatpost is to connect the saddle to the bike.
Cheap bikes may have a "straight" seatpost that is a simple, unadorned tube. "Seat guts" are a separate mechanism that clamps the straight seatpost to the seat. The seat guts clamp onto the saddle rails, and the guts slip onto the post, and it is all tightened up by snugging 2 nuts on either side of the guts, usually with a 14 mm open wrench. So, to adjust the saddle angle on a straight seatpost, with a (usually) 14 mm open wrench, loosen the nuts, move the saddle to the desired angle, and tighten the bolts.
Most bikes have a "micro-adjust" seatpost, with an integrated mechanism that clamps the seatpost to the seat rails. On most seatposts, the post top has a concave surface, which is fit to a separate plate having a convex surface, which is clamped to the seat rails, all of which is connected by the seatpost bolt. To adjust the saddle angle on a micro-adjust seatpost, loosen the seatpost bolt (usually with a 6 mm hex wrench) and move your convex and concave surfaces to achieve the desired angle, and tighten the bolt.
It's pretty common to break a seatpost bolt, or to bend the seat rails, or to bend the seatpost. This happens because you are "lead butting it." In other words, you are sitting on the saddle when you run into bumps. Lead butt--broken stuff! When you are going to hit a bump, suspend yourself by standing on the pedals. That saves your equipment and your fleshy ole booty.
Before putting a seatpost in a bike, lightly grease the inside of the bike's seat tube. I've seen nice bikes ruined because the seatpost bound to the inside of the bike seat tube, a totally preventable debacle. (Some carbon seatpost manufacturers suggest not to use grease.)
Seatposts are clamped into the bike seat tube several ways--all obvious by looking. The clamps will have either a quick release device or a seatpost binder bolt. The binder bolts strip easy, since they are steel and often thread into aluminum, and they have to be torqued pretty hard--so be careful, and lightly grease the bolt.
Seatpost maintenance is easy. Periodically remove the post and clean the old grease from the post and the inside of the bike's seat tube. If there is any moisture in the seat tube, dry it out. Lightly grease the inside of the seat tube, drop some lube on all the bolts and nuts, and reinstall the post.
Seatposts can be steel (cheap stuff), aluminum or carbon fiber. Aluminum is a good choice. It is said that carbon fiber posts can be engineered for superior stiffness--in just the right way, etc... . Maybe, maybe not. But score a carbon fiber tube and it is weakened. Carbon fiber breaks, not bends. Aluminum generally bends before it breaks. Break a seatpost and get badly hurt.
Seatposts come in different lengths and diameters. Your replacement post can be a different length from the original, but the diameter has to be the same. The diameter is usually stamped toward the bottom of the post, with 27.2 mm being the most common.
Seatposts have a safety line. Do not extend the seatpost so much that the safety line can be seen above the bike's seat tube. Not only are you likely to break the post, but the bike's seat tube, too, and it will not be warranted.
If you want to adjust the cockpit of your bike, for example to give you more room between the seat and the handlebar, you may be able to find a "laid back" seatpost. However, they are usually very expensive. The cockpit is usually adjusted by getting a longer or shorter stem.
Believe it or not, people steal seatposts, probably because it is so easy to flip a quick release and lift one out. If you park your bike in a high crime area, buy a "seat leash" cable for some protection. Seatpost thieves are stupid, so the slightest deterrent should be enough.
Suspension seatposts are getting more and more common, especially on hybrids and comfort bikes. They really do help comfortwise. On most of them, stiffness can be adjusted. Take the post out of the bike and look at the inside. There is probably a hex wrench fitting that you can advance clockwise to stiffen the spring or counterclockwise to loosen it. On more expensive suspension posts, replacement springs are available that offer even more adjustability.