For a pretty good explanation of how the wormholes themselves work, you can read the
evelopedia article on wormholes.
Be aware when entering a wormhole (if the wormhole leads to unknown space) that the only points you will be able to warp to without bookmarks are the sun, planets and their moons. There are no stargates or stations. So in other words
bookmark your entrance wormhole! If you don't, and do not have a probe launcher, you will be stuck and cannot leave unless someone shows you an exit wormhole or you get podded. Either by getting killed or by self-destructing.
Now, what you're probably interested in when raiding wormholes are the combat sites. Combat sites are either anomalies that can easily be found either using the on-board scanner or very easily using scan probes (I'll assume you know how to use scan probes and the on-board scanner). Anomalies are fairly common and their difficulty depends a bit on the site, but anomalies in a given wormhole system are roughly equally hard (list of all W-space anomalies
here. Wormhole systems are classified in difficulty from class 1-6 (C1-C6) Where C1 anomalies contain only frigate and cruiser sized sleepers, C2 contain frigs, cruisers and the occasional battleship and C3 where every site has at least one battleship. C4 and higher you don't want to do solo, so I'll not talk about those here.
All systems can also spawn radar or magnetometric sites which contain loot containers that needs to be opened using either a codebreaker or an analyzer. These contain bits and bobs used in the production of T3 ships. The sleepers at these sites are more numerous than at the anomalies, and usually they are closer to the next class of difficulty than the one you're in (i.e. a C2 radar site will be close to a C3 anomaly in difficulty). They, however yield more loot and salvage, and are thus more lucrative. They also needs to be scanned down, like any other cosmic signature.
For C1 wormholes I'd recommend a Battlecruiser or an assault frigate with good skills. In C2s, an AF will probably have a tough times with sentries doing a lot of damage and being webbed while BS's are present. Sleeper battleships dish out
a lot of damage. I'd recommend a BC for C2's. C3's can be done in a supertanked BC, but you'll take ages to finish stuff. A T3 cruiser is better, but almost two orders of magnitude more expensive.
Regarding the loot and salvage: the higher class of wormhole you go to, the more valuable the loot will be in proportion to the salvage. In our C3, the loot the sleepers drop is roughly equally valuable as the salvage. In C1 and C2's the salvage (i.e. the melted nanoribbons, the other salvage is basically junk) will probably outweigh the loot in value.
When in W-space, you'll not have an automatically updating local channel, so you won't know how many people are in system with you unless they speak in local (they never do). So what you'll want to do is to learn to use D-scan and be paranoid. For whatever reason, the evelopedia seems to lack a guide on the directional scanner, so I'll explain it here instead. The directional scanner (D-scan) is basically an active sonar ping. It shows you what is in space in a given (solid) angle from you (usually 360°) within a certain range (max ~14 AU). It, along with some basic spatial awareness will give you a pretty good heads up if someone is about to jump you (unless they're cloaked, which happens surprisingly often). Don't forget to scan a few times every minute, every 5 seconds ideally.