How to clean my OpenSSL installation

I use Ubuntu 18.04. It was shipped with OpenSSL 1.1.0g . I tried to link manually compiled Python to a manually compiled OpenSSL1.1.1a but things does not seem to work well. When I now run Python it is automatically linked to OpenSSL1.1.1a. I want to revert this. I want to restore OpenSSL1.1.0g as the default library for my system and my system’s installed python. When I check my system’s OpenSSL version I get:

OpenSSL 1.1.0g  2 Nov 2017 (Library: OpenSSL 1.1.1a  20 Nov 2018) 

When I check:

whereis openssl 

I get:

openssl: /usr/bin/openssl /usr/include/openssl /usr/local/openssl /usr/local/openssl/bin/openssl /usr/share/man/man1/openssl.1ssl.gz 

How can I remove OpenSSL 1.1.1a and just leave the system’s OpenSSL 1.1.0g? How can I make Python linked to OpenSSL 1.1.0g? Any Python is linked to OpenSSL 1.1.1a now.