Match the substitute to the job: for smooth melt on heat, choose a processed American product or a cheddar+fat blend.
Use the ratio (generally 1:1 for the same amount of cheese).
If the substitute is drier or melts grainy (shreds, mozzarella, cheddar), add a small splash of milk or butter and warm gently until smooth.
Do a 20–30 second melt test in a spoonful on low heat; adjust with a tiny pinch of salt or a bit more fat if needed.
In baking, shred/tear smaller and keep heat moderate so it melts before it dries out.