so i have been watching a lot of youtube videos involving guitarists racks and i dont understand how they work, do they run alongside your conventional head and cab or are they essentially the amp head and all your other effects etc and then they are connecting up to cabs which would be on-stage with you.
Can someone explain please?
thanks in advance
You can run a rack in many ways. Some will have the preamp and power amp as separate rack units, some people will run a normal amp separate to the rack and some people (like me) have a normal amp mounted in their rack. A rack can have just effects and no amp at all or have everything in it. It's all down to what you personally prefer.
A picture tells a thousand words:

As you can see, the amp was small enough to fit so that's what I did.
Gilchrist custom
Yamaha SBG500
Randall RM100 & RM20
Marshall JTM45 clone
Marshall JCM900 4102 (modded)
Marshall 18W clone
Fender 5F1 Champ clone
Atomic Amplifire
Marshall 1960A
Boss GT-100

Cathbard Amplification
My band
they can be either example you gave. Some rack-mounted products are similar to effects pedals (though often more powerful/more options) that you would put either between your guitar and amp, or in the effects loop of your amp. There are also rack-mounted amp heads, which would output to a cab, though I think the cab would be offstage and mic'd in that situation, and the mic run through the PA system of the venue.
Schecter Hellraiser C-1
Fernandes Dragonfly
Peavey Valveking 112

If I could write off your murder, I'd save all of my receipts,
because I'd rather you be dead, than lose a tiny shred of what I made this fiscal year - Dethklok