Oh dear, has it never occurred to you to search for “potting compound” ?
The proper stuff for the job.
Now, if you live in the UK, you can have almost anything available, in a couple of days, because we still do serious electronics here, and have a robust supply chain (for now).
E.g. https://uk.rs-online.com/web/c/adhesives-sealants-tapes/adhesives-glues/potting-compounds/
If you want to try to bodge things up with totally unsuitable “cheap” (not actually, when they fail) materials, maybe from a DIY warehouse, particularly any cheap silicones (more thermal insulator than conductor) that smell of vinegar and will corrode everything, eventually, well, you’ve got it wrong.
The thing is, that mixing up a batch of a good potting compound, even in a small sachet, is expensive, and you had better be prepared to use it wisely, which means more than just one hobby experiment. If this interests you, then you will need to do your own research, choose the materials that work for you, are available, and that you can afford (i.e. not only delivered in 1Kg tubs MOQ, like the professional ones).
Develop your own methods, experiment, don’t expect to get it right first time, or have your hand held.
Edit: did I also mention time and temperature ? Fundamental.
And it is mostly unnecessary, except for those of us who have an application for an assembly that can survive extreme G-force, repeatedly. Some do, and will pay for that assurance.