Internal cabling varies. Some systems use a thin plastic inner sheath installed in the tubing which guides the inner cables through the tube between the entry and exit points. If this is installed and left in place then the inner cable can simply be fed through with no worries. Some bikes come with installing tubes in place, which can be used to guide the cable through, then removed. This is great until you want to renew the cables, as without them it's very hit and miss to install the new ones, if not impossible. This is where the ghetto sheath I described above comes in handy. It slides up the old inner cable inside the frame, and sticks out at the entry and exit points.
There are methods involving tying a strand of cotton or dental floss onto the new inner, and using a vacuum cleaner to draw it through the frame, then using it to lead the new inner through. Very fiddly, but great as an emergency.
My Cube frame has guided channels for the gear inners, and I assumed the same for the brake cable along the top tube. I discovered to my cost that it isn't guided, so when I took the old cable out it was impossible to feed the new cable in through the entrance and out of the exit. Fortunately I discovered you can remove the exit guide and reach in with a hooked pick to remove the end of the cable before sliding the guide back on and snapping it back into place.
My Canyon MTB frame has no guides, but the cables sort of nearly always exit at the BB. The easiest way to do it is to mount the frame in a stand, ensuring the downtube is vertical, crouch under the bike, find a torch, make sure I'm looking through the right part of my varifocals, avoiding glare from the window or workshop lights and spend ten or so minutes scrabbling about with a hooked pick whilst swearing profusely.
Don't worry about contamination, a wipe with a dry rag will get rid of any dust or debris. Don't use any solvent. Many inners come with either a polymer coating, or a PTFE coating, both of which will be knackered by using a solvent.