modeling a can type of object

how do i model an object so that the sides are smooth or rounded but like a few edges are still sharp?

By “can type” you mean like a cylinder, where the edges around top and bottom are sharp and all others building the sides are smooth?
If you add a cylinder and use “set smooth” on it, these edges will be smoothed too. You can prevent this by usind the “Edge Split” modifier. It works based on the angle, which will do fine in this case, or on “mark sharp” marking. For this, in edit mode select the edges you want sharp and select “mark sharp” in the CTRL-E menu.

Auto-Smooth works similar, but with less flexibility.

If you are working with sub surfaces you can “crease” edges (SHIFT-E).