I’d try simplifying things by first ignoring the Texture Paint and Shading Workspaces and just doing everything from the default Workspace. Split your window in half and split one half in half again vertically. Set one window to Image Editor. Set another to Shader editor. Make sure you have created and saved an image and that it is the same in both Image Editor and loaded into the correct place in the Material nodes. If you then set the main 3d Viewport to Texture Paint and the Image Editor from View to Paint you should be able to paint in either window in 2D or in 3D.
If find it a lot more helpful than the two preset Workspaces tbh