There are 2 ways, the easy way, and the hard way:
- The Easy Way
Find someone with an inheritable claim on the kingdom and marry them to your heir or yourself. I was King of Ireland and married the Queen of Sweden. When she died, my heir became King of Sweden (by this time, he was already King of Ireland) automatically, without any fight.
- The Hard Way
Fabricate claims, or find people of your dynasty who have claims on the target kingdom's individual counties. Go first for those counties that are in large duchies (duchies with 4 or 5 counties), as once you have 3/5 duchies, you can take the rest of the duchy through de jure claims. De jure claims are great as they go to your demesne (if you are the duke). You want the large duchies as its quicker then to get to 51%, and then press for the whole realm in a de jure claim on the kingdom. To speed it all up, you need to either assassinate or plot to kill the king of the target kingdom whenever there is a truce. Also, fermenting dissent in their kingdoms helps break them up (when their vassels rebel, you immediately conquer them before they have a chance to go back to their old king).
Personally, if it is a large kingdom, the first way takes a fraction of the time and effort (maybe 5% of the effort).
You want to think carefully about which Kingdoms you go for. I was king of Ireland and conquered Scotland, Wales, Brittany and England - all of them. Then I died and my heir inherited just Ireland, Brittany and Wales. I only inherited Brittany and Wales as I had never created the titles, so they were de jure part of Ireland. The others were gavelkind, so my 3 kingdoms were divided between my sons. This caused a phobia of gavelkind to develop and I then got Sweden (primogeniture), and conquered Scotland (renamed to Alba as I'm Irish) before converting it to Primogeniture. Primo is great as succession wars are few. I still haven't got England on Primo, so when I get old, I save up a war chest of money and then win a brutally fast succession war upon succession. It must be fast as you want to continually upgrade to high authority so that you can convert to primo (kill your brother -the king- if you can't start a war). When you lose the kingdom, the first thing the bastard does is downgrade crown authority, so that you will never get primo! Get in before the laws are passed!!!
I could go for an emperor title but then I risk losing the kingdoms in successions. Ultimately, I try to convert my kingdoms to primo, then downgrade crown authority so that my vassals don't rebel every 2 minutes.