note: the following is entirely theoretical. my chemistry knowledge is laughably insufficient.
firstly - you'd have to convert it from the sodium associated enolate anion (? I've definitely fucked up the terminology already) to its base form using something like NaOH or KOH and perhaps a nudge in the form of heat or motion (centrifuge whee). also take into account what the inactive ingredients are, as they may react with the intermediate product or convert along with the pentobarbital. if the former - figure out a way to separate them out prior to A/B converting. the latter will be dealt with later.
second - once everything has converted (use excess base reagent to force equilibrium to completion), find some metric that would allow the active ingredient to be separated out from the others. for instance - boiling point (distill then condense, retain desired portion), affinity to a particular molecule which can then be precipitated out of solution (be the molecule a metal, halide, etc - drop in then filter the precipitate out)
(I'm sure there are more ways but I'm coming up with this as I type and my brain stopped producing output around the second idea)
third - if you wish to vaporise (smoke) the base you are done - just add propylene glycol and / or vegetable glycerin in the desired ratio and puff away (literally). to obtain a powder which can then be dissolved for injection, you must first convert the base back into its acid salt form. I would look up the solubility in water of the various possible salts (not an exhaustive list: citrate, acetate, sulphate, hydrochloride/bromide/iodide, etc) and select a reagent that contains the desired component to yield the most highly soluble product.
eg if you select the HCl salt as the desired product (idk about pentobarb - but meth, coke, and heroin HCl all dissolve quite nicely) - slowly add an excess of hydrochloric acid to the pentobarbital. stopper the flask and dance a jig around your laboratory with it to force all the molecules of pentobarbital to contact the acid. if that doesn't seem to work, give it a good hard slap. slap it around some more. show that bastard who's king.
idk it should probably precipitate out or something. if it doesn't do that on its own you may need to gently coax the crystals out by convincing them you come in peace evaporating in a glass baking dish or large tray - 10-20 degrees below the melting point of the final product, which you want to remain a solid.
eight hours later.....just kidding, no idea how long it would take. just babysit it until it looks done. set a timer for every hour at first and then every ten minutes towards the end.
oh and by the way be sure to wear safety goggles and gloves and a hazmat suit and your grandmum's lucky necklace (tucked in, of course) so as not to cause any unfortunate accidents. the goal is to die, not to suffer permanent horrible injury, yes?
an alternate method of the extraction would involve solidifying the original pentobarbital (? if it is even possible) and dissolving it in a solvent that solvates most inert cut and leaves the pentobarbital sodium in its crystallised form. you would have to wait (24-48h) for the solvent to evaporate unless you fancy injecting or snorting lighter fluid.
all right matey i've got to pop off to work now. haven't slept at all whoo this was fun