How do I learn opponent ship details?
In missions, every NPC has a set damage type that they deal and are weak against. The Eve University Wiki has a full list of the various types.
Take Sansha for example (common in Amarr space). They deal EM/Thermal (laser) damage, so it's best to tank against that. They also happen to be weak against EM/Thermal, so lasers do the best damage (or alternatively, EM missiles or drones).
Against players is a different ballgame and there's no easy way to tell where the weak points are.
It has been quite some time since I have played EVE Online, so please view my answer framed with that disclaimer.
Since you mention missions, you might want to make yourself aware of the EVE Survival Guide: http://eve-survival.org/wikka.php?wakka=HomePage. In my mission running days this was an indispensable guide for making my way though missions. It should also be mentioned that there are only a limited number of missions at each mission hub, and you will start to see a lot of repeats over time.
If you are referring to PVP, you can always fit a ship scanner module, but I personally would recommend against it unless flying a specialized ship as a part of a fleet. In most cases when flying solo, the ship scanner will take up valuable CPU and PowerGrid resources that can be used better used for other ship modules. Further, when you consider that a ship scanner will rarely give you an entire list of a ship's modules, the benefit is rarely outpaced by the fitting cost.