Modeling Advice - Extrude Organic Shape
You could do it this way, create a cubic shape, select the vertical edges:

Bevel:

Bevel the top and bottom edges:

Give it a Subdivision Surface modifier, it should work without artifacts: