Double consonants are pronounced as a single consonant if they're a part of the same word. However, there are so called long consonants that happen if a one sound preposition is connected to a word starting with the same sound (or the preposition sound cognate, e.g с/з в/ф are cognates) as the preposition itself.
For example
с собой vs собой - these two are not pronounced the same
собой is pronounced with an ordinary с sound but
c собой is pronounced with a slightly prolonged, sustained "с"
в воде vs воде - the same thing
Cognates merging into one long voiced or unvoiced sound examples
в форме vs форме - в форме is pronounced with long unvoiced "ф" sound /ф:орме/ (The ":" sign represents a long sound in IPA if you don't know)
с замка vs замка - c замка is pronounced with long voiced "з" sound /з:амка/
Note that the long consonant is not pronounced as long as compared to just an ordinary consonant, just sligtly, almost vaguely longer, but still this is enough for native speakers to always get the difference.
I hope this helps