How do you deal with enemy titans while you're not in a titan?
Mounting a titan (known as rodeo'ing) is pretty easy on paper. You just have to jump into the uppermost part of the titan and it automatically goes through the sequence of attacking the titan.
The first time you or an ally rodeo an enemy titan you will steal their battery. The battery grants the titan a shield and some hp. Once you steal the battery you can give it to any friendly titan to grant them that shield and give them some hp. Any time you rodeo after the battery is stolen, your pilot will drop a grenade into the empty battery socket dealing a good amount of damage to the titan. The real difficulty of rodeo'ing is getting high up enough to trigger it all while not being noticed.
As for what you can do beyond rodeo'ing it highly depends on your weapons. Energy weapons and explosives hurt titans a good amount, regular bullets barely do enough to even waste the time shooting at them. The best advice I can give is to stay high up and use your mobility to your advantage. titans are slow moving and can not chase pilots well. Titans can not jump (except the ones with the fly ability) so staying high makes it far easier for you to get to cover when a titan does notice you. If you have to staying indoors is also good but it makes it hard to harass the titans.