How to simplify/clean up a mesh? I imagine this is a fairly popular problem to have, but I can't seem to find the right terminology, so I apologize in advance.

I am currently creating rather simple shapes, mostly by combining simple meshes, using the boolean modifier. However, this leaves artifacts which lead to all kinds of unwanted behavior.

The simplest way to recreate what I mean is to boolean -> union two cubes of the same size:



The upper mesh in the picture is the union with all its weird artifacts, the lower mesh is what I'd like to get to. I tried mesh -> clean up in edit mode, but apart from removing loose vertices, it doesn't really help much. Also, just deleting them in edit mode leads to all kinds of weird behavior.

I also tried the remesh modifier, which works on the example above and feels like it's the right answer, but it just doesn't work at all on my actual project (which I don't want to share here).
Can this be due to the fact that all kinds of already applied modifiers still interact with each other?

A somewhat adjacent problem I faced are vertices which lie on the inside of a mesh.

Is there a simple way to solve this? Ideal for my use would be a tool/modifier which essentially retraces the surface of a mesh and removes any unneeded vertices, such as vertices that are on a flat surface, or that are creating weird loops and such.

I hope that makes somewhat sense.

Thanks in advance and regards,

tt
Generally I would advise not worrying about topology when you model. Clean topology can be essential and a mark of good modeling skills but its much better to model first and retopologise later. 

The reason being unless you have decided exactly what your final form will be, topology will be simply impossible to predict. 

You can waste a ton of time being a perfectionist in 3d graphics, so it is better to keep it simple focus on just modeling the form you want. After you finish you can always either edit your mesh to fix topology problems or you can create new topology using the snap to surface or wrap skin modifier tools. 

There are of course cases where bad topology can get in the way of modeling the object in that case you either edit the mesh to correct these problems or retopologise it. There is the remesher as you pointed but quickly you will find there is no golden tool in any 3d graphics app that will clean up your topology which is why specialised apps that focus on this problem exist. 

If you wanna stick to clean topology from the get go then I advise to avoid using booleans. Booleans are more suitable for models where good topology does not matter or models that it matters a lot and they will retopologised later on.