I am trying to get this right but don't get the second part where there is a eighth note and followed by 2 sixteenth note
6/8 is compound duple time. So in 6/8 there are two dotted crotchets (dotted quarter notes) beats to a bar. The beams should reflect this.
There are three quavers (eighth notes) pulses to a dotted crotchet. And there are two semiquavers (sixteenth notes) to a quaver.
Starting on a beat (at the start, or halfway through a bar):
If a set of three quavers appear in a row, they should beam together (like in the first bar). Similarly, if a set of six semiquavers appear in a row, they should beam together.
A pair of semiquavers can substitute for a quaver, so that you'll get two quavers plus two semiquavers to a beam, or one quaver plus four semiquavers to a beam.
Consider a dotted quaver as a quaver tied to a semiquaver.
Be careful not to beam across beats (so that the halfway point through the bar should be clear).
While the number of semis are the same in 3/4 and 6/8, the important difference is how they're written on the sheet music. 3/4 is simply 3 crotchets (or their equivalents) written as 3 separate beats.
6/8, however, is written in two distinct halves, each equal, of course. That means the equivalent to one and a half crotchets (3 quavers/ 6 semis) are written in each half of any bar. To make it easier to read, the beams will reflect this, and join any/all notes in each half, visually splitting the bar into equal halves.
6/8 is two beats in each bar. Each beat adds up to a dotted quarter. Beam to show this. If one entire beat can be included under a single beab, do so. In bar 2 of your example, the first 4 notes and the last 4 notes add up to a beat, and can be beamed together. So do so.