@saramg You time your arrival for the current conditions to be amenable. Getting this stuff right is a big part of RYA sailing courses.
In duress, you can burn diesel (the ebb through Portsmouth harbour’s entrance can be a bugger, but that’s only a few hundred metres), or you can drop a hook and wait for the tide to turn or slacken.